
Why I can't pass to WNDCLASS callback function but can if it static
This behavior is by design. A member function used as a callback function
must be static. A non-static member function cannot be used as a callback
function. You can also use file scope global functions for callback
functions.
In C++ every member function has a hidden parameter known as the "this"
pointer. C++ is able to associate a function with a particular instance of
an object by means of the "this" pointer. Therefore, if a callback
function, defined as a non-static member function, is called, it will
expect a particular instance of an object.
-Allen
Disclaimer:
This posting is provided "AS IS" with no warranties, and confers no rights.