Jump to content
  • Advertisement
Sign in to follow this  
B_old

MessageCallback with asCALL_THISCALL

This topic is 3529 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

Hi again, my stuff runs again now after the update, except that this seems to be a problem (only in debug, running fine in release):
m_engine->SetMessageCallback(asMETHOD(ScriptEngine, messageCallback), this, asCALL_THISCALL);
This is the error message 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. Any ideas? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Is your messageCallback a static method of the ScriptEngine? If it is then you need to register it with asCALL_CDECL instead of asCALL_THISCALL. If that is not the problem, then please show us the ScriptEngine::messageCallback function signature so that we can verify if it is correct (parameters, return type, etc).

Regards,
Andreas

Share this post


Link to post
Share on other sites
It is a non-static method:

//.h
class ScriptEngine
{
//...
asIScriptEngine *m_engine;
public:
//...
void messageCallback(const asSMessageInfo *msg, void *param);
};
//.cpp
//...
m_engine->SetMessageCallback(asMETHOD(ScriptEngine, messageCallback), this, asCALL_THISCALL);


Works fine in release but not in debug.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!