Thread: WinAPI Wrapper and WndProc

  1. #1
    The Defective GRAPE Lurker's Avatar
    Join Date
    Feb 2003
    Posts
    949

    WinAPI Wrapper and WndProc

    I'm creating a WinAPI / OpenGL wrapper class, and I'm wondering how to handle WndProc. How can you pass a pointer to it? Can it be a class function? Give me any ideas you have! Thanks!
    Do not make direct eye contact with me.

  2. #2
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790
    well, winproc is just a function pointer in the first place, so you can actually add it to your class if you so choose. and to call a pointer to it , just use WNDPROC * :P.

  3. #3
    Registered User dalek's Avatar
    Join Date
    May 2003
    Posts
    135
    Some pretty good examples over Here.

    Basically, the windows procedure needs to be a static method to work correctly, but this is rather inconvenient as a static method has no this pointer. It also means you can only call static member variables of your class.

    To get around this, you need to have a static message router. Basically a static version of the windows procedure that will route messages to a non-static version of your windows procedure.

    There are a number of examples in the thread above.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Different approaches to making a Win32 wrapper
    By xds4lx in forum Windows Programming
    Replies: 16
    Last Post: 02-27-2002, 04:49 PM