資源簡介
控制臺嵌入MFC,可以在mfc對話框中直接輸入cmd命令

代碼片段和文件信息
//?MyCmd.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“MyCmd.h“
#include?“MyCmdDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CMyCmdApp
BEGIN_MESSAGE_MAP(CMyCmdApp?CWinApp)
//{{AFX_MSG_MAP(CMyCmdApp)
//?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()
/////////////////////////////////////////////////////////////////////////////
//?CMyCmdApp?construction
CMyCmdApp::CMyCmdApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CMyCmdApp?object
CMyCmdApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CMyCmdApp?initialization
BOOL?CMyCmdApp::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
CMyCmdDlg?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;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-09-18?16:54??Debug\
?????文件??????100864??2013-09-18?16:52??Debug\MyCmd.exe
?????文件???????35604??2010-10-24?15:58??MyCmd.aps
?????文件????????1061??2010-10-24?17:58??MyCmd.clw
?????文件????????2063??2010-10-24?15:56??MyCmd.cpp
?????文件????????4141??2010-10-24?15:31??MyCmd.dsp
?????文件?????????535??2010-10-24?15:31??MyCmd.dsw
?????文件????????1406??2010-10-24?15:44??MyCmd.h
?????文件???????49664??2010-10-24?17:58??MyCmd.opt
?????文件?????????947??2010-10-24?17:42??MyCmd.plg
?????文件????????5314??2010-10-24?15:58??MyCmd.rc
?????文件?????????875??2012-12-25?12:38??MyCmd.sln
?????文件???????10752??2013-09-18?16:54??MyCmd.suo
?????文件????????7292??2012-12-25?12:38??MyCmd.vcproj
?????文件???????10099??2013-09-18?16:52??MyCmdDlg.cpp
?????文件????????1853??2010-10-24?17:21??MyCmdDlg.h
?????文件????????3561??2010-10-24?15:31??ReadMe.txt
?????文件?????????532??2010-10-24?15:31??Resource.h
?????文件?????????207??2010-10-24?15:31??StdAfx.cpp
?????文件????????1054??2010-10-24?15:31??StdAfx.h
?????目錄???????????0??2013-03-28?10:55??res\
?????文件????????1078??2010-10-24?15:31??res\MyCmd.ico
?????文件?????????397??2010-10-24?15:31??res\MyCmd.rc2
評論
共有 條評論