Static function only access static variable in c++ because instance variable has to be accessed by objects and static function are accessed by class name and its execution during runtime is much more faster than class member function.
Callback functions typically allow you to pass a pointer (or something that can be used as a pointer) to the callback functions. Use it for the class's address so you can invoke it directly in the callback.
thanks Duoas.
let me ask: you used the lParam for HWND. but imagine that if you need, too, the wParam? LRESULT CALLBACK MsgBoxHook(int nCode, WPARAM wParam, LPARAM lParam)
like you see my CALLBACK have more parameters. can you explain more, please?
thanks Duoas. thanks for all.
now i can use a static CALLBACK, only, for call the non CALLBACK function, that i don't need a static members for use them. thanks for alll. really thanks
1) a static function which matches the expected callback, and calls the member function
2) a member function, which should look just like the static function except without the lParam argument
3) a function that initializes the callback mechanism, passing the object's instance as the lParam 'data' argument.