Re: Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.

From: Gold'n'Green (andy_at_adsgroup.com)
Date: 10/18/04


Date: Mon, 18 Oct 2004 22:10:52 +0100

John,

Unfortunately that is just an error that sneeked in from a previous
attempted fix. It fails the sam way without that error.

Thanks anyway.

Regards,

Andy.

"John Phillips" <jjphillipsREMOVE@REMOVEhotmail.com> wrote in message
news:uH5VSaUtEHA.3016@TK2MSFTNGP12.phx.gbl...
> Well, for starters, I wouldn't assign a pointer of type IMemberAuth to
> pointer of type IUnknown (CreateInstance() call).
>
> --
> John Phillips
> MVP - Windows SDK
>
>
>
> "Gold'n'Green" <andy@adsgroup.com> wrote in message
> news:41741253$0$20850$db0fefd9@news.zen.co.uk...
>> Hi,
>>
>> When I execute the following code:
>>
>> IUnknown *pIUnknown = NULL;
>> IClassFactory *pIClassFactory = NULL;
>> HRESULT hr = CoGetClassObject( CLSID_MemberAuth,
>> CLSCTX_INPROC_SERVER,
>> NULL,
>> IID_IClassFactory,
>> (void **)&pIClassFactory );
>> if( SUCCEEDED( hr ) ) {
>> hr = pIClassFactory->CreateInstance( NULL,
>> IID_IMemberAuth,
>> (void **)&pIUnknown );
>> }
>> INSSAuthenticator *pIMemberAuth = NULL;
>> GUID iGuid;
>> hr = pIUnknown->QueryInterface( IID_IMemberAuth,
>> (void **)&pIMemberAuth );
>> if( SUCCEEDED( hr ) ) {
>> // *** Fails on this line ***
>> pIMemberAuth->GetAuthenticatorClass( &iGuid );
>> }
>>
>> On the line indicated I get:
>>
>> "Run-Time Check Failure #0 - The value of ESP was not properly saved
> across
>> a function call. This is usually a result of calling a function declared
>> with one calling convention with a function pointer declared with a
>> different calling convention."
>>
>> I have tried everything I can think of and searched numerous articles. In
>> particular I have set the calling conventions in the project properties
>> correctly.
>>
>> Does anyone have any other ideas?
>>
>> Thanks,
>>
>> Andy.
>>
>>
>
>



Relevant Pages

  • Re: Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.
    ... Well, for starters, I wouldn't assign a pointer of type IMemberAuth to ... pointer of type IUnknown call). ... > different calling convention." ...
    (microsoft.public.win32.programmer.ole)
  • Re: Pointers, DLL Header files and lots of exceptions?
    ... When choosing a calling convention, Delphi uses the last one specified. ... In a Win32 program, cdecl is mentioned before stdcall, so Delphi uses ... passed as a pointer, so on the surface, they are the same things. ... uses the stack, including how it allocates hidden, temporary variables. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Pointers to functions: Is this the right [f03] syntax?
    ... Andy wrote: ... that the pointer p in the original code points to a subroutine, ... references in the same scope; there's just no way to declare such a ...
    (comp.lang.fortran)
  • Re: Calling a function by hand
    ... > I was going to create a procedure that accepts the function pointer ... > if I know its calling convention and its parameters. ... > array will tell me what the parameter types are. ... - Zero extend/sign extend to 32-bits, then typecast ...
    (borland.public.delphi.language.basm)
  • Re: Multithreading and static object initialisation.
    ... which puts the MB between the pointer read and the ... it is possible for CPU2 to have cached the ... I assume it's more efficient to have MB4 in the ... Andy ...
    (microsoft.public.vc.language)