I have written a Dll in C, which calls a function in an ActiveX Dll(written in VB). The C interface to this ActiveX function requires some parameters to be passed in as BSTR *.
The function in the C Dll which calls this ActiveX function gets the data as LPCTSTR parameters. Here's part of the code to explain what I mean.
_clsTestVbDll *pClass = NULL;
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
DataCheck( LPCTSTR docAction, LPCTSTR elmAction)
//call to activex function in vb
pClass->lpVtbl->MyVBFunctionStr(pClass, docAction, &sOutput);
// amongst other things
virtual /* [id] */ HRESULT STDMETHODCALLTYPE MyVBFunctionStr(
/* [out][in] */ BSTR __RPC_FAR *sStr,
/* [retval][out] */ short __RPC_FAR *__MIDL_0015) = 0;
When the application calls the DataCheck () in the C Dll, it crashes as it can't convert the data from LPCTSTR to BSTR *. Any ideas on how I can get this working?