Of course thats not a nice code and I wouldnt use it in my program anyway.
But iam simply wondering why its not possible to use the thiscall calling
convention just like any other?
"Pete Becker" <petebecker@acm.org> schrieb im Newsbeitrag
news:8fCdnWM3ap1Fkm3fRVn-oA@rcn.net...[color=blue]
> Frank Neuhaus wrote:[color=green]
> > It is already virtual, because the CGame class is an abstract base[/color][/color]
class.[color=blue][color=green]
> >[/color]
>
> I didn't read your code closely enough. You've actually simulated a
> simple virtual call there. The comment on the actual call is slightly
> incorrect: it's not the location of the function inside the class, but
> the location of the function pointer in the class's vtable. But that
> particular calling sequence won't work with a non-virtual function, and
> might or might not work when the this pointer points to a virtual base,
> and won't work with an implementation that doesn't lay objects out the
> same way as your compiler. Pointers to member functions hide all this
> detail, all of which is implementation-specific, anyway.
>
> This sort of asm-level hacking should only be done in the privacy of
> your own home. <g>
>
> --
>
> Pete Becker
> Dinkumware, Ltd. (
http://www.dinkumware.com)[/color]