you might check if you are using the correct proxy-stub
dll file. Which should be generated during the server
build and should get correctly registered.
Quote:
>-----Original Message-----
>Hey all,
>I'm having problems calling a COM object in VC++ .NET
(WIN32 target). I'm
>using COM smart pointers with the "#import" directive.
>I'm getting an error: "Run-Time Check Failure #0 - The
value of ESP was not
Quote:
>properly saved across a function call. This is usally a
result of calling a
>function declared with one calling convention with a
function pointer
>declared with a different calling convention."
>My code is something like --
>#define _WIN32_DCOM
>#include "stdafx.h"
>#import "si_com.dll" /* creates namespace SI_COMLib */
>#define SI_ProgID "Si_com.SIWrapper"
>int _tmain(int argc, _TCHAR* argv[])
>{
> CoInitialize(NULL);
> SI_COMLib::ISIWrapperPtr oSI;
> oSI.CreateInstance("SI_COM.SIWrapper");
> oSI->PutWorkingDirectory("c:\\Program
Files\\Cardlink\\SISv2");
Quote:
> int resp = oSI->SITest(); <<== this is the offending
line of code
> CoUninitialize();
> return 0;
>}
>The de{*filter*} stops in the _generated_ code --
>inline int ISIWrapper::SITest ( ) {
>int _result = 0;
>HRESULT _hr = raw_SITest(&_result); <<== BREAKS HERE
>if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof
(this));
>return _result;
>}
>Any ideas anyone, please? Is this my fault (I assume it
is) ?
>Thanks,
>Alex.
>.