Thread: wndclass.lpfnWndProc

  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
    julie lexx... btq's Avatar
    Join Date
    Jun 2002
    Posts
    161
    heyo..
    had the same query a while back...

    http://cboard.cprogramming.com/showt...threadid=25611

    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 04: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