PInvoke error while accesing a OCX  
Author Message
Julien GV

PostPosted: Visual C++ Language, PInvoke error while accesing a OCX Top

I am using a OCX which doesn't have a GUI so I have to instanciate it myself. I have a wrapper class created by the wizard and I have made sure the MFC project can accept ActiveX controls.

After some research i have found a way to intanciate m_pCtrlSite pointer and my classe but when I make a call to a function an error happens on this line :

m_pCtrlSite->InvokeHelperV(dwDispID, wFlags, vtRet, pvRet, pbParamInfo,argList);

Here is the error

Unhandled exception at 0x783c0e2a (mfc80ud.dll) in MFC.exe: 0xC0000005: Access violation reading location 0x001c2151.

Here is the line i use to intanciate my object :

CcGdPicture* oOgPicture = (CcGdPicture*)CcGdPicture::GetThisClass();

Any help would be apreciated.


Visual C++5