• Advertisement

Archived

This topic is now archived and is closed to further replies.

Run-time check error... HUH?

This topic is 5187 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

anyone know what this means? "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." it pointed me to this... bool SPRITE::Render() { if (FAILED(SPRITE::Sprite->Draw(SPRITE:Tex, NULL, NULL, NULL, NULL, &(SPRITE:osition), 0xFFFFFFFF))) return FALSE; return TRUE; } pTex is a valid LDIRECT3DTEXTURE9 and Position is a ZeroMemory()-ed D3DVECTOR2 huh?

Share this post


Link to post
Share on other sites
Advertisement
Did you try Google and Google Groups? MSDN?

Either you''re clobbering ESP with a buffer over/underflow or, like the error message says, your calling conventions differ.

I don''t know why you prefix the class name onto member variables, either.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Based on your code, it looks like you are calling a static function pointer of a class (or namespace).

What this tells me is the calling convention of the function pointer type and the function you are calling is different. If that is truely the case though, I am suprised you aren''t getting a compiler warning or error.

In any case, your function pointer needs to be of the same type as the function, including calling convention!

typedef void (*MyDrawFuncPtr __stdcall)(int x, int y);

The "__stdcall" is the key here (my syntax may be incorrect). Windows calls are __stdcall calling convention.

If you are switching between a Windows function and your own function, make sure your function has the correct calling convention as well.

void DrawFunc __stdcall (int x, int y)
{
}

This way you can switch your pointer back and forth without a problem.

Share this post


Link to post
Share on other sites
Is it possibly because ive included the dx libs more than once? (in different source files) and by included i mean #pragma comment(lib, "d3d9.lib) and that crap

Share this post


Link to post
Share on other sites
I cant go to the real google for whatever reason, same with yahoo, i use this mysearch thing.... that supposedly will search through google...

Share this post


Link to post
Share on other sites

  • Advertisement