class member function as callback function 
Author Message
 class member function as callback function

hi all,

How to define a class member function as "CALLBACK" and pass it's
pointer to some DLL call?

Thanks,
Nilesh Dhakras.



Mon, 13 Dec 2004 13:12:21 GMT  
 class member function as callback function

Quote:
>How to define a class member function as "CALLBACK" and pass it's
>pointer to some DLL call?

The issue here is usually that non-static class members have the
invisible "this" pointer parameter - so the solution is to use a
static member function. See if you can find an article on MSDN "Member
Functions as Callbacks" - which references in MSDN purport to give
more information, but the article itself appears to be absent from the
current MSDN CD.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Mon, 13 Dec 2004 17:59:28 GMT  
 class member function as callback function

Quote:

> How to define a class member function as "CALLBACK" and pass it's
> pointer to some DLL call?

If you can't switch it to a static member function, you'll have to use
some sort of wrapper (which will essentially convert your normal
member function into a static member function).


Mon, 13 Dec 2004 22:02:32 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Passing C++ Class Member Function to as a C Callback Function Parameter

2. How to use member function of a C++ class as a callback function

3. Accessing class member functions from Global Callback

4. Getting pointer to non-static member function from C callback function

5. Callback functions as member functions

6. Calling C++ member function through C function callback

7. CALLBACK Functions as Class Members

8. Making DDEML Callback function a member of a class

9. CALLBACK DLGPROC as a class member function

10. Using Non-Static Callback Functions as member Functions VC5.0

11. Making DDEML Callback function a member of a class

12. Using class member function as a thread function

 

 
Powered by phpBB® Forum Software