Hi guys,

I have a COM exe server, which I added the following interface:

.h
[id(184), helpstring("method GetChange")] HRESULT GetChange([out] BSTR *pVal);

.cpp
STDMETHODIMP CATL::GetChange(BSTR *pVal)
{
CString strCommand;

bstr_t bstr( "Hello" );
*pVal = bstr.copy( );

return S_OK;
}

and I call it from my CLient like this:


BSTR Change;
ComObj->GetChange( & Change );


The problem is everytime I get to execute this instruction my application gets an access violation error and the callstack shows
RPCRT4! 7802e81c() as the method. It does not even get to the COM function, I debugged to make sure it's not the function that is causing this, any ideas why this is happening??/

Thanks a lot