New Window class - cannot convert LRESULT Class:: to LRESULT

Discussion in 'Win32' started by c0d3m0nk3y, Aug 28, 2010.

  1. c0d3m0nk3y

    c0d3m0nk3y New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I have two methods in my main.cpp file that deal with creating a new window.

    Firstly HWND NewWindow(...) which creates a WNDCLASSEX struct, defines some settings & registers the window.
    One of the settings is
    Code:
    wndStructure.lpfnWndProc = WindowProcedure;
    WindowProcedure in this case is the second method LRESULT CALLBACK WindowProcedure(...), this defines the events that will happen based on the Messages (I think?).
    
    I wanted to move all of this code out of my main.cpp file into it's own class. The problem rises on the aforementioned line of code.
    The method is now declared as HWND ClassName::NewWindow(...) and the error I receive is:

    error C2440: 'type cast' : cannot convert from 'LRESULT (__stdcall ClassName::* )(HWND,UINT,WPARAM,LPARAM)' to 'LRESULT'
    I am assuming that it is not recognising the return type as LRESULT because it is ClassName::LRESULT.

    How can I get around this problem?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice