資源簡介
使用MFC向導創建了一個基于對話框的程序,實現了為對話框添加菜單和菜單消息響應。

代碼片段和文件信息
//?DlgWithMenu.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“DlgWithMenu.h“
#include?“DlgWithMenuDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CDlgWithMenuApp
BEGIN_MESSAGE_MAP(CDlgWithMenuApp?CWinApp)
//{{AFX_MSG_MAP(CDlgWithMenuApp)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code!
//}}AFX_MSG
ON_COMMAND(ID_HELP?CWinApp::onhelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CDlgWithMenuApp?construction
CDlgWithMenuApp::CDlgWithMenuApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CDlgWithMenuApp?object
CDlgWithMenuApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CDlgWithMenuApp?initialization
BOOL?CDlgWithMenuApp::InitInstance()
{
AfxEnableControlContainer();
//?Standard?initialization
//?If?you?are?not?using?these?features?and?wish?to?reduce?the?size
//??of?your?final?executable?you?should?remove?from?the?following
//??the?specific?initialization?routines?you?do?not?need.
#ifdef?_AFXDLL
Enable3dControls(); //?Call?this?when?using?MFC?in?a?shared?DLL
#else
Enable3dControlsStatic(); //?Call?this?when?linking?to?MFC?statically
#endif
CDlgWithMenuDlg?dlg;
m_pMainWnd?=?&dlg;
int?nResponse?=?dlg.DoModal();
if?(nResponse?==?IDOK)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?OK
}
else?if?(nResponse?==?IDCANCEL)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?Cancel
}
//?Since?the?dialog?has?been?closed?return?FALSE?so?that?we?exit?the
//??application?rather?than?start?the?application‘s?message?pump.
return?FALSE;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????36348??2012-08-31?21:41??DlgWithMenu\DlgWithMenu.aps
?????文件???????1600??2012-08-31?21:41??DlgWithMenu\DlgWithMenu.clw
?????文件???????2133??2012-08-31?21:21??DlgWithMenu\DlgWithMenu.cpp
?????文件???????4145??2012-08-31?21:21??DlgWithMenu\DlgWithMenu.dsp
?????文件????????545??2012-08-31?21:21??DlgWithMenu\DlgWithMenu.dsw
?????文件???????1379??2012-08-31?21:21??DlgWithMenu\DlgWithMenu.h
?????文件???????6328??2012-08-31?21:41??DlgWithMenu\DlgWithMenu.rc
?????文件???????4386??2012-08-31?21:31??DlgWithMenu\DlgWithMenuDlg.cpp
?????文件???????1459??2012-08-31?21:31??DlgWithMenu\DlgWithMenuDlg.h
?????文件???????3669??2012-08-31?21:21??DlgWithMenu\ReadMe.txt
?????文件???????1078??2012-08-31?21:21??DlgWithMenu\res\DlgWithMenu.ico
?????文件????????403??2012-08-31?21:21??DlgWithMenu\res\DlgWithMenu.rc2
?????文件????????780??2012-08-31?21:23??DlgWithMenu\resource.h
?????文件????????213??2012-08-31?21:21??DlgWithMenu\StdAfx.cpp
?????文件???????1054??2012-08-31?21:21??DlgWithMenu\StdAfx.h
?????目錄??????????0??2012-08-31?21:21??DlgWithMenu\res
?????目錄??????????0??2012-08-31?21:41??DlgWithMenu
-----------?---------??----------?-----??----
????????????????65520????????????????????17
- 上一篇:C++API中文版
- 下一篇:用C語言實現ARC圓弧插補計算
評論
共有 條評論