Link to home
Start Free TrialLog in
Avatar of mbensimo
mbensimo

asked on

Instanciating an ActiveX control into a C program

Hello,

I am making a C program which should use an ActiveX control.

I have an ActiveX control and i know its CLSID, I want to use it so I do :

hr = CoInitializeEx ( NULL, COINIT_MULTITHREADED );

then

hr = CoCreateInstance ( &clsid,
            NULL,
            CLSCTX_INPROC_SERVER,
            &IID_IUnknown, //(REFIID) &giid,
            &ppv );

If I do so ... I have a link error LNK2001 telling me : unresolved external symbol IID_IUnknown

When I am using an ActiveX control is it a proper manner user IID_IUnknown as the REFIID, if not what should i use as the REFIID and how do I define it.


ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of harshvir_drish
harshvir_drish

Hi,

i want to call an activex control from my dll code but when i use the interface of activex control in my dll then it says
"undeclared identifier".
i know my dll code doesn't find the declaration of interface's pointer.
can you please tell me which header files or libraries i have to include so that i can get the pointer of my activex control.