• Advertisement
Sign in to follow this  

Return values for 1.7.x

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

I was trying to return a bool value to the host app from the script. here's my code..... ------------------ C++ CODE -------------------------------engine->GetFunctionIDByName("test"); Context->Execute(); DWORD j=0; Context->GetReturnValue( &j, 0 ); bool bState = (bool)j; ---------------------------------------------------------- ----------------- SCRIPT CODE ---------------------------- bool test() { OutputDebugMessage("test works!"); return true; } ---------------------------------------------------------- Is this right? cos I dont seem to be getting results even though i get a debug outputstring!

Share this post


Link to post
Share on other sites
Advertisement
Change it to


Context->GetReturnValue( &j, 1 );


and I believe it will work. You were telling the engine to copy 0 dwords to the j variable, which of course wouldn't work. [wink]

Share this post


Link to post
Share on other sites
Oops! seems to be working now? is there anyway i could directly obtain values in the right data type since i think typecasting might be slower.

Share this post


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

  • Advertisement