Advertisement Jump to content
Sign in to follow this  

Delphi bind to AS Error

This topic is 3673 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 tried to implement Angelscript in Delphi. Therefore i wrote this struct-equivalent of asSMessageInfo:


 pasSMessageInfo = ^asSMessageInfo;
  asSMessageInfo = packed record
    sec: pchar;
    row: integer;
    col: integer;
    kind: integer;
    msg: pchar;

asEngine_SetMessageCallback(angel_engine,@AngelScriptMessageCB,nil,asCALL_CDECL); with
procedure AngelScriptMessageCB( const mi: pasSMessageInfo; p: pointer );cdecl;

but the output just shows eg AS:??????????<?????????????>(0,0) Did i do anything wrong while converting the asSMessageInfo struct?

Share this post

Link to post
Share on other sites
I'm not familiar with Delphi but it looks like you've declared everything correctly.

It may be a difference in size on the pchar versus const char * types.

Does const mi: a pointer to the message information structure?

If this doesn't work, then perhaps you can write a simple wrapper callback in C++ that translates the asSMessageInfo structure to separate parameters that Delphi understands.


Share this post

Link to post
Share on other sites
Set a breakpoint on that line and run it. Then check the value's of mi^.msg and mi^.sec. Also check whether "mi" points to correct data. What version of delphi do you use?

If you need further help, i'd suggest you to register at You'll find more pascal/delphi programmers there that can help you out. :)

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!