At 08:28 AM 11/3/2003, Alexander Mavrov wrote:
Can someone tell me how (if possible) can I call a member function of a class from the inline assembly of CodeWarrior

First, is the member a static member, an ordinary member, or a virtual member? The methods to call these kind of members vary.


A static member function is just like a global function except that it's inside a class namespace.

A normal member function is also like a global function, but with a hidden first parameter that is a "this" pointer for the object.

Virtual member functions are called by indirecting through the this pointer, getting the address of the right virtual function table, then retrieving the member address from the VFT, and calling it indirectly.

I suggest you build a few examples of these calls and use the "disassemble" command to look at the code. The inline assembler may not be able to compute the offsets that you need for a virtual function, so you might just want to make a C stub that calls the C++ method for you, and have your inline assembly call the stub.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com



-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to