IDispatch - I NEED HELP!

J

Julaet

Hi,



I have a registred ocx that implements the fallow method

CString COPOSCashDrawer::GetDeviceDescription()
{
CString result;
InvokeHelper(0x1d, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
return result;
}

I created a dll that implements the fallow method:

STDMETHODIMP CCashDrawer::get_DeviceDescription(BSTR *pVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())

CComBSTR bstStr( this->DeviceDescription );

*pVal=bstStr.Detach();

// TODO: Add your implementation code here

return S_OK;
}

This method belongs interface ICashDrawer : IDispatch

I want to do a application that make the ocx's method
CString COPOSCashDrawer::GetDeviceDescription() make call to the dll's method
STDMETHODIMP CCashDrawer::get_DeviceDescription(BSTR *pVal)

I tryed to import the Controll into a project(Project->Add to
Project->Componentes and Controls->Registred ActiveX Controls), then I tryed
to create a instance of a ocx's class and make call to the method
GetDeviceDescription(). The fallow error menssage was draw me:

DEBUG ASSERTION ERROR!
File: Winocc.cpp
Line: 345

Please, can you help me?

Grateful!
 
Top