News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

callback function

Started by ecube, September 16, 2008, 05:21:54 PM

Previous topic - Next topic

ecube

I have a function in c++ that I compiled as a static lib, and I linked in that .lib in my asm project. After that I called the c++ function and passed it the address of a function in my main asm code as a callback. I tested it and it calls my asm function fine from the c++ lib and the asm function can read the string passed as a param ok, the problem is my program crashes when my asm callback function reaches the end and calls "ret", the debugger shows the address as 000000 any advice? :\


oh and when I call the c++ function(That calls my asm callback functionn) it's in another thread...not sure how much that affects things.


*FIX, sorry my asm function was fun proc C, and apparently it had to be stdcall so changing it fixed things, :)

Adamanteus

That's need by debugger in asm function look in dump of [ESP - 4], where placed return address. and check how it will correct be placed in EIP.