Callback continued
-
As I've read in my previous post "Callback and Assembly", there are more then one way to get it done. It's about a Callback procedure in a class. The following methods I came accross: Static with a pointer to the class to call the non-static member Thunking, as is done in ATL with use of assembly Convert thiscall to a callback, but it's highly inportable. Attaching a class and a HWND into a Dynamic Array, and use a global Callback that calls the right class (use virtual member functions) I'm curious, how many more great ways are there to do an OO-callback LPCTSTR Dutch = TEXT("Double Dutch :-)");
-
As I've read in my previous post "Callback and Assembly", there are more then one way to get it done. It's about a Callback procedure in a class. The following methods I came accross: Static with a pointer to the class to call the non-static member Thunking, as is done in ATL with use of assembly Convert thiscall to a callback, but it's highly inportable. Attaching a class and a HWND into a Dynamic Array, and use a global Callback that calls the right class (use virtual member functions) I'm curious, how many more great ways are there to do an OO-callback LPCTSTR Dutch = TEXT("Double Dutch :-)");
Thunking/converting thiscall to callback without using fancy assembler tricks, but adapter objects and C++ standard language features as described in my article Use member functions for C-style callbacks and threads - a general solution. The article focusses on dealing with the typical Win32 API callbacks, however, the underlaying technique is generic and portable. -- Daniel Lohmann http://www.losoft.de (Hey, this page is worth looking! You can find some free and handy NT tools there :-D )