LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I have problem programming the "Windows SDK COM" the function " CoInitialize" is ok but "CoCreateInstance" doesn't compiled it return strange error mismatch of parameters types... and I don't what to do

Ok function definition is:

STDAPI CoCreateInstance(
REFCLSID rclsid, //Class identifier (CLSID of the object
LPUNKNOWN pUnkOuter, //Pointer to controlling IUnknown
DWORD dwClsContext, //Context for running executable code
REFIID riid, //Reference to the identifier of the interface
LPVOID * ppv //Address of output variable that receives
// the interface pointer requested in riid
);

and my compiling errors are:

78, 35 Type error in argument 1 to `CoCreateInstance'; found 'CLSID' expe
cted
'const pointer to const IID'.

78, 70 Type error in argument 4 to `CoCreateInstance'; found 'IID' expected
'const pointer to const IID'.

I did try to change the calling convention but always the same error...

Thank...
0 Kudos
Message 1 of 2
(3,072 Views)
It looks like this function is expecting these two arguments to be passed by reference. If you put a & in front of the variable name in the function call it should fix it.

Best Regards,

Chris Matthews
Measurement Studio Support Manager
0 Kudos
Message 2 of 2
(3,072 Views)