
How can I call a VB ActiveX dll from VC++
I have tried to call my VB ActiveX dll from VC++
Below is what I have tried:
/*Global Scope*/
const IID IID_IclsOutlook;
DEFINE_GUID(IID_IclsOutlook,
0x4601081CL, 0x6E79, 0x48D9, 0xAA, 0x0F, 0x68, 0x4B, 0x58, 0xE3, 0x5D,
0xA5);
void CVBCallerDlg::OnButton1()
{
CLSID clsid;
void *ppv;
HRESULT hr;
hr=CoInitialize(NULL);
hr= CoCreateInstance(clsid,
NULL,
CLSCTX_INPROC_SERVER,
IID_IclsOutlook,
(void **)&ppv);
ppv->Initialize();
Quote:
}
When I build the code I get this error:
error C2227: left of '->Initialize' must point to class/struct/union
If I remove the line of code I don't receive any error when I build the
project.
The Initialize() function exists in my ActiveX.dll, but I don't even get any
class members up when I type ppv->, so I know there is something wrong.
I'm a newbie to VC and COM.
Hope that someone can help me,
regards,
Stian