Playing with callbacks in Excel (and Maple) i found the
following code in an old MS article (KB171729) to be
compiled in C into a DLL with standard convention:
__declspec(naked) void Callback()
/* For procedures with return values of 8 bytes or less */
/* Get address to be called and fix-up return address */
_asm pop eax; // save return address
_asm pop ecx; // get address to JMP to
_asm push eax; // restore return address
_asm jmp ecx; // Jump to callback function....
Which works. And as Excel is slow that would be enough (for
concrete situations i do not need that 'general' solution),
the nice things is, that this will be called from Excel by
value (not by reference).
Out of curiousity i wanted to do that directly as assembler
DLL using MASM, not MSVC. But can not find out how to define
the function in MASM (ok, it is a proc, not a function ...,
but what to use for the parameters?).
Any advice what to do (i am a assembler moron)? TIA.
mail (at) axelvogt.de