MFC_Tutorial_5.cpp
上传用户:conquerdj
上传日期:2018-03-29
资源大小:33k
文件大小:1k
- //MFC_Tutorial_5.cpp
- #include <afxwin.h>
- #include "resource.h"
- #include "MyDialog.h"
- class MFC_Tutorial_Window :public CFrameWnd
- {
- CMenu menu1;
- public:
- MFC_Tutorial_Window()
- {
- Create(NULL,"MFC Tutorial Part 1 CoderSource Window");
- menu1.LoadMenu(IDR_MENU1);
- SetMenu(&menu1);
- }
- void OnDialogNew();
-
- DECLARE_MESSAGE_MAP()
- };
- BEGIN_MESSAGE_MAP( MFC_Tutorial_Window, CFrameWnd)
- ON_COMMAND(ID_DIALOG_NEW,OnDialogNew)
- END_MESSAGE_MAP()
- void MFC_Tutorial_Window::OnDialogNew()
- {
- MyDialog dlg;
- dlg.DoModal();
-
- }
- class MyApp :public CWinApp
- {
- MFC_Tutorial_Window *wnd;
- public:
- BOOL InitInstance()
- {
- wnd = new MFC_Tutorial_Window();
- m_pMainWnd = wnd;
- m_pMainWnd->ShowWindow(1);
- return 1;
- }
- };
- MyApp theApp;