Search code examples
c++mfcwindows-messagesmessage-map

c++ MFC and handling windows Messages


What code is needed in the message map for Windows messages?

The code calling the function:

SendMessage(GRID_WM_UPDATECELL,(WPARAM)1,(LPARAM)&sDisp);

The function:

LRESULT CNJAGridCtrl::OnUpdateCell(WPARAM wParam, LPARAM lParam)
{
}

Solution

  • The message map line should be

    ON_MESSAGE(GRID_WM_UPDATECELL, OnUpdateCell) 
    

    and the function signature should be

    LRESULT CNJAGridCtrl::OnUpdateCell(WPARAM wParam, LPARAM lParam);