wndclass.lpfnWndProc

This is a discussion on wndclass.lpfnWndProc within the C++ Programming forums, part of the General Programming Boards category; Hi. I tried this: Code: class appl{ public: LRESULT CALLBACK thecrew(HWND,MSG,LPARAM,WPARAM){ // however, I planned to make this my program's ...

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    60

    wndclass.lpfnWndProc

    Hi. I tried this:
    Code:
    class appl{
    public:
    LRESULT CALLBACK thecrew(HWND,MSG,LPARAM,WPARAM){
    // however, I planned to make this my program's WndProc}
    };
    int WinMain( // ...
    {
    WNDCLASSEX wncl;
    
    // Now: this is my problem:
    
    wncl.lpfnWndProc=appl::thecrew;
    
    /*the compiler doesn't accept the command above
      I also tried this: */
    
    int WinMain(// ...
    {
    WNDCLASSEX wncl;
    appl applclass;
    wncl.lpfnWndProc=applclass.thecrew;
    
    /*the compiler doesn't accept this either.
     So: It's my compiler's fault, isn't it? */

  2. #2
    btq
    btq is offline
    julie lexx... btq's Avatar
    Join Date
    Jun 2002
    Posts
    161
    heyo..
    had the same query a while back...

    callbacks within a class?

    shoutout to FillYourBrain for that one..
    works like a charm..

    what you do is you put a pointer to the instance of the class in the GWL_USERDATA of the window, declare the proc static ,blablabla...it's all in the link

    /btq
    Last edited by btq; 10-15-2002 at 05:53 AM.
    ...viewlexx - julie lexx

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Deriving from CWindow
    By xds4lx in forum Windows Programming
    Replies: 4
    Last Post: 02-22-2002, 05:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21