bahar 0 Newbie Poster

Hi all,

I added Redo to the MenuBar of a MFC application and added the corresponding variables and functions to the CMainFrame class. The added lines to the message map is like this:

CPP / C++ / C Code:

ON_COMMAND(ID_EDIT_UNDO, OnEditUndo)

After adding these lines, a linker error occured saying
" error LNK2001: unresolved external symbol "public: void __thiscall CMainFrame::OnEditRedo(void)" (?OnEditRedo@CMainFrame@@QAEXXZ)".

Also the added variables in the CMainFrame class are :
CPP / C++ / C Code:

afx_msg void OnEditUndo();
afx_msg void OnUpdateEditUndo(CCmdUI *pCmdUI);
afx_msg void OnEditRedo();
afx_msg void OnUpdateEditRedo(CCmdUI *pCmdUI);


The implementations of the functions OnEditUndo, OnEditUpdateUndo, OnEditRedo and OnEditUpdateRedo are empty. It is like:


void CMainFrame::OnEditRedo()
{

}


What can be the reason of the linker error after the additions to the message map.

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.