include "MainFrm.h"
//и самое главное
LRESULT [COLOR=red]CMainFrame::[/COLOR]OnAddNode(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/){
int a=0;
return 0;
}
WTL ToolBar
<MainFrm.h>
BEGIN_MSG_MAP(CMainFrame)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
COMMAND_ID_HANDLER(ID_APP_EXIT, OnFileExit)
COMMAND_ID_HANDLER(ID_FILE_NEW, OnFileNew)
COMMAND_ID_HANDLER(ID_VIEW_TOOLBAR, OnViewToolBar)
COMMAND_ID_HANDLER(ID_VIEW_STATUS_BAR, OnViewStatusBar)
COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout)
//
COMMAND_ID_HANDLER(ID_ADD_NODE, OnAddNode)
//
CHAIN_MSG_MAP(CUpdateUI<CMainFrame>)
CHAIN_MSG_MAP(CFrameWindowImpl<CMainFrame>)
END_MSG_MAP()
...
LRESULT OnAddNode(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
<MainFrm.cpp>
LRESULT OnAddNode(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/){
int a=0;
return 0;
}
На что получаю
Linking...
First.obj : error LNK2001: unresolved external symbol "public: long __thiscall CMainFrame::OnAddNode(unsigned short,unsigned short,struct HWND__ *,int &)" (?OnAddNode@CMainFrame@@QAEJGGPAUHWND__@@AAH@Z)
Debug\First.exe : fatal error LNK1120: 1 unresolved externals
Цитата:
Originally posted by lexus
Помогите разобраться с WTL ToolBar
<MainFrm.h>
BEGIN_MSG_MAP(CMainFrame)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
COMMAND_ID_HANDLER(ID_APP_EXIT, OnFileExit)
COMMAND_ID_HANDLER(ID_FILE_NEW, OnFileNew)
COMMAND_ID_HANDLER(ID_VIEW_TOOLBAR, OnViewToolBar)
COMMAND_ID_HANDLER(ID_VIEW_STATUS_BAR, OnViewStatusBar)
COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout)
//
COMMAND_ID_HANDLER(ID_ADD_NODE, OnAddNode)
//
CHAIN_MSG_MAP(CUpdateUI<CMainFrame>)
CHAIN_MSG_MAP(CFrameWindowImpl<CMainFrame>)
END_MSG_MAP()
...
LRESULT OnAddNode(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
<MainFrm.cpp>
LRESULT OnAddNode(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/){
int a=0;
return 0;
}
На что получаю
Linking...
First.obj : error LNK2001: unresolved external symbol "public: long __thiscall CMainFrame::OnAddNode(unsigned short,unsigned short,struct HWND__ *,int &)" (?OnAddNode@CMainFrame@@QAEJGGPAUHWND__@@AAH@Z)
Debug\First.exe : fatal error LNK1120: 1 unresolved externals
Помогите разобраться с WTL ToolBar
<MainFrm.h>
BEGIN_MSG_MAP(CMainFrame)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
COMMAND_ID_HANDLER(ID_APP_EXIT, OnFileExit)
COMMAND_ID_HANDLER(ID_FILE_NEW, OnFileNew)
COMMAND_ID_HANDLER(ID_VIEW_TOOLBAR, OnViewToolBar)
COMMAND_ID_HANDLER(ID_VIEW_STATUS_BAR, OnViewStatusBar)
COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout)
//
COMMAND_ID_HANDLER(ID_ADD_NODE, OnAddNode)
//
CHAIN_MSG_MAP(CUpdateUI<CMainFrame>)
CHAIN_MSG_MAP(CFrameWindowImpl<CMainFrame>)
END_MSG_MAP()
...
LRESULT OnAddNode(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
<MainFrm.cpp>
LRESULT OnAddNode(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/){
int a=0;
return 0;
}
На что получаю
Linking...
First.obj : error LNK2001: unresolved external symbol "public: long __thiscall CMainFrame::OnAddNode(unsigned short,unsigned short,struct HWND__ *,int &)" (?OnAddNode@CMainFrame@@QAEJGGPAUHWND__@@AAH@Z)
Debug\First.exe : fatal error LNK1120: 1 unresolved externals
Пожключи в MainFrm.cpp MainFrm.h
Так:
Код: