请用伪代码表示以下C++程序

BEGIN_MESSAGE_MAP(CTestApp,CWinApp)ON_COMMAND(ID_HELP,&CWinApp::OnHelp)END_MESSAGE_MA... BEGIN_MESSAGE_MAP(CTestApp, CWinApp)
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()

// CTestApp construction

CTestApp::CTestApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}

// The one and only CTestApp object

CTestApp theApp;

// CTestApp initialization

BOOL CTestApp::InitInstance()
{
// InitCommonControlsEx() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// Set this to include all the common control classes you want to use
// in your application.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);

CWinApp::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
// Change the registry key under which our settings are stored
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization
SetRegistryKey(_T("Local AppWizard-Generated Applications"));

CTestDlg dlg;
m_pMainWnd = &dlg;
INT_PTR 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;
}
展开
 我来答
Xuxu8511
2010-11-23 · TA获得超过388个赞
知道小有建树答主
回答量:1344
采纳率:0%
帮助的人:769万
展开全部
这是MFC工程下,CWinApp类的.cpp 文件的部分代码。

BEGIN_MESSAGE_MAP(CTestApp, CWinApp)
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()
//上面是一个宏,即消息映射机制。ID_HELP消息和CWinApp::OnHelp对应。

// CTestApp construction

CTestApp::CTestApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
//构造函数。。

// The one and only CTestApp object

CTestApp theApp; //全局变量

// CTestApp initialization

BOOL CTestApp::InitInstance() //程序的一些实现的函数调用。你把其实默认的改动了。。 建议这个函数的东西不要改,CMainFrame类和CTestView类中去实现自己的功能
{
// InitCommonControlsEx() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// Set this to include all the common control classes you want to use
// in your application.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);

CWinApp::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
// Change the registry key under which our settings are stored
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization
SetRegistryKey(_T("Local AppWizard-Generated Applications"));

CTestDlg dlg;
m_pMainWnd = &dlg;
INT_PTR 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;
}
hydonlee
2010-11-23 · TA获得超过590个赞
知道小有建树答主
回答量:859
采纳率:0%
帮助的人:435万
展开全部
这个程序...貌似只是一个框架...没有实现具体的功能啊...

你确定是想用伪码来描述一个MFC的空框架么?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式