Hi -
I have created wrapper classes around Win32 API calls in GNU C++ (v 4.3.1) using Win32API library (v 3.11). I am having difficulty in the implementation of API functions that require callback functions as arguments (presumably since I have declared the callback functions as member functions of the class instead of in the global scope and have not implemented the c++ equivalent of a delegate function).

Here is a simple example using the EnumWindows Win32 API call:

Code:
class MyClass {

    public:
        void AccessorFunc() {
            EnumWindows(this->EnumWindowsProc, 0);
        }
    private:
        BOOL CALLBACK MyClass::EnumWindowsProc(HWND hWnd, LPARAM lParam) {
            // do whatever...
        }
};
I receive the following compile-time error using the MinGW compiler (version 3.14):

Code:
In member function 'void MyClass::AccessorFunc()' argument type 'BOOL (MyClass::)(HWND__*,LPARAM)' does not match 'BOOL (*)(HWND__*,LPARAM)'
MSDN put together an article on "How to: Implement Callback Functions" with this same scenario using .NET, C# and VC++ frameworks, which makes use of the delegate function.

I'm still working on getting up-to-speed on the c++ implementation of the delegate function, though I would like to avoid the use of additional functions outside the class scope in preference of an inline solution, if feasible. At this point, any suggestions are welcome to get the code to compile.

Thanks!