OnMessage Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • meipv

    #1

    OnMessage Error

    I have an MFC application. I am getting this error when I attempt to
    compile: error C2440: static cast: cannot convert from
    'void(_thiscall (CNameDlg::*)(W PARAM, LPARAM) to LRESULT(_thisca ll
    CWnd::*)(WPARAM ,LPARAM)'.

    This is basically where the error occurs.
    BEGIN_MESSAGE_M AP(CNameDlg, CDialog)
    ON_MESSAGE(LJ_M ESSAGE, OnProcess)
    END_MESSAGE_MAP

    Anyone's help would be greatly appreciated.


  • Jeff Partch

    #2
    Re: OnMessage Error

    "meipv" <ljunior@apheli on.net> wrote in message
    news:OV9$A8jSDH A.1948@TK2MSFTN GP12.phx.gbl...[color=blue]
    > I have an MFC application. I am getting this error when I attempt to
    > compile: error C2440: static cast: cannot convert from
    > 'void(_thiscall (CNameDlg::*)(W PARAM, LPARAM) to LRESULT(_thisca ll
    > CWnd::*)(WPARAM ,LPARAM)'.
    >
    > This is basically where the error occurs.
    > BEGIN_MESSAGE_M AP(CNameDlg, CDialog)
    > ON_MESSAGE(LJ_M ESSAGE, OnProcess)
    > END_MESSAGE_MAP
    >
    > Anyone's help would be greatly appreciated.[/color]

    Change the handler function to match the expected prototype...

    LRESULT CNameDialog::On Process(WPARAM wParam, LPARAM lParam)

    --
    Jeff Partch [VC++ MVP]



    Comment

    Working...