Hi, z33z. The function I use is this:
The "..." represents infinite parameters with a *marker pointer.
PutValue(comobj o, LPCOLESTR command, ...);
Now I call the function like this:
"%s" tells me the parameter is an LPSTR argument and "%e" is a double.
Put Value(rdPtr->obj, L"Columns(%s).Size = %e", param, param, param, param, param, param,
param, param, param, param, param);
The param[i] array is a pointer array which I change the types of each pointer individually depending on what is passed by the user. So I must have in param, by the example above, an LPSTR string and in param a double. Since there are only two arguments in the command(%s and %e), the rest of the parameters passed will be NULL and that is acceptable by the function.
The user passes as arguments a string like "A:E,250.95" which I extract the parameters individually and convert the pointer accordingly.
The rest of the parameters, I pass NULL. If in param, there is an int, the function will work correctly. I've tried with many parameters at the same time and if they are not of DOUBLE type, it'll work flawlessly.
parameter1 = "A:E";
parameter2 = 250.95;
param = reinterpret_cast<void*>(ConvertBstrToAnsiStr(parameter1.bstrVal));
param = reinterpret_cast<void*>(¶meter2.dblVal);
Can you see what's wrong here, please? If not, I can send you the source code. Thank you once again.