資源簡介
在vc6.0下建立MFC單一對話框,實現(xiàn)單擊菜單項,彈出對話框。

代碼片段和文件信息
//?MainFrm.cpp?:?implementation?of?the?CMainframe?class
//
#include?“stdafx.h“
#include?“MyTest.h“
#include?“MainFrm.h“
#include?“MyDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CMainframe
IMPLEMENT_DYNCREATE(CMainframe?CframeWnd)
BEGIN_MESSAGE_MAP(CMainframe?CframeWnd)
//{{AFX_MSG_MAP(CMainframe)
ON_WM_CREATE()
ON_COMMAND(ID_CLICK?onclick)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static?UINT?indicators[]?=
{
ID_SEPARATOR???????????//?status?line?indicator
ID_INDICATOR_CAPS
ID_INDICATOR_NUM
ID_INDICATOR_SCRL
};
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?construction/destruction
CMainframe::CMainframe()
{
//?TODO:?add?member?initialization?code?here
}
CMainframe::~CMainframe()
{
}
int?CMainframe::OnCreate(LPCREATESTRUCT?lpCreateStruct)
{
if?(CframeWnd::OnCreate(lpCreateStruct)?==?-1)
return?-1;
if?(!m_wndToolBar.CreateEx(this?TBstyle_FLAT?WS_CHILD?|?WS_VISIBLE?|?CBRS_TOP
|?CBRS_GRIPPER?|?CBRS_TOOLTIPS?|?CBRS_FLYBY?|?CBRS_SIZE_DYNAMIC)?||
!m_wndToolBar.LoadToolBar(IDR_MAINframe))
{
TRACE0(“Failed?to?create?toolbar\n“);
return?-1;??????//?fail?to?create
}
if?(!m_wndStatusBar.Create(this)?||
!m_wndStatusBar.SetIndicators(indicators
??sizeof(indicators)/sizeof(UINT)))
{
TRACE0(“Failed?to?create?status?bar\n“);
return?-1;??????//?fail?to?create
}
//?TODO:?Delete?these?three?lines?if?you?don‘t?want?the?toolbar?to
//??be?dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return?0;
}
BOOL?CMainframe::PreCreateWindow(CREATESTRUCT&?cs)
{
if(?!CframeWnd::PreCreateWindow(cs)?)
return?FALSE;
//?TODO:?Modify?the?Window?class?or?styles?here?by?modifying
//??the?CREATESTRUCT?cs
return?TRUE;
}
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?diagnostics
#ifdef?_DEBUG
void?CMainframe::AssertValid()?const
{
CframeWnd::AssertValid();
}
void?CMainframe::Dump(CDumpContext&?dc)?const
{
CframeWnd::Dump(dc);
}
#endif?//_DEBUG
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?message?handlers
void?CMainframe::onclick()?
{
//?TODO:?Add?your?command?handler?code?here
CMyDlg?dlg;
dlg.DoModal();
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????21703??2010-10-09?13:50??MyTestvc6.0的單擊\Debug\MainFrm.obj
?????文件???????9806??2010-10-09?13:50??MyTestvc6.0的單擊\Debug\MyDlg.obj
?????文件?????118832??2010-10-09?13:50??MyTestvc6.0的單擊\Debug\MyTest.exe
?????文件?????300444??2010-10-09?13:50??MyTestvc6.0的單擊\Debug\MyTest.ilk
?????文件??????22710??2010-10-09?13:50??MyTestvc6.0的單擊\Debug\MyTest.obj
?????文件????5503668??2010-10-09?13:50??MyTestvc6.0的單擊\Debug\MyTest.pch
?????文件?????328704??2010-10-09?13:50??MyTestvc6.0的單擊\Debug\MyTest.pdb
?????文件???????7448??2010-10-09?13:50??MyTestvc6.0的單擊\Debug\MyTest.res
?????文件??????14483??2010-10-09?13:50??MyTestvc6.0的單擊\Debug\MyTestDoc.obj
?????文件??????19412??2010-10-09?13:50??MyTestvc6.0的單擊\Debug\MyTestView.obj
?????文件?????105416??2010-10-09?13:50??MyTestvc6.0的單擊\Debug\StdAfx.obj
?????文件?????197632??2010-10-09?13:53??MyTestvc6.0的單擊\Debug\vc60.idb
?????文件?????364544??2010-10-09?13:50??MyTestvc6.0的單擊\Debug\vc60.pdb
?????文件???????2531??2010-10-09?13:50??MyTestvc6.0的單擊\MainFrm.cpp
?????文件???????1466??2010-10-09?13:49??MyTestvc6.0的單擊\MainFrm.h
?????文件????????973??2010-10-09?13:44??MyTestvc6.0的單擊\MyDlg.cpp
?????文件???????1209??2010-10-09?13:44??MyTestvc6.0的單擊\MyDlg.h
?????文件??????44152??2010-10-09?13:50??MyTestvc6.0的單擊\MyTest.aps
?????文件???????2654??2010-10-09?14:03??MyTestvc6.0的單擊\MyTest.clw
?????文件???????4209??2010-10-09?13:44??MyTestvc6.0的單擊\MyTest.cpp
?????文件???????4677??2010-10-09?14:35??MyTestvc6.0的單擊\MyTest.dsp
?????文件????????535??2010-10-09?13:44??MyTestvc6.0的單擊\MyTest.dsw
?????文件???????1356??2010-10-09?13:44??MyTestvc6.0的單擊\MyTest.h
?????文件??????50176??2010-10-09?14:35??MyTestvc6.0的單擊\MyTest.ncb
?????文件??????48640??2010-10-09?14:35??MyTestvc6.0的單擊\MyTest.opt
?????文件???????1840??2010-10-09?13:50??MyTestvc6.0的單擊\MyTest.plg
?????文件??????12120??2010-10-09?13:50??MyTestvc6.0的單擊\MyTest.rc
?????文件???????1742??2010-10-09?13:44??MyTestvc6.0的單擊\MyTestDoc.cpp
?????文件???????1475??2010-10-09?13:44??MyTestvc6.0的單擊\MyTestDoc.h
?????文件???????2579??2010-10-09?13:44??MyTestvc6.0的單擊\MyTestView.cpp
............此處省略15個文件信息
評論
共有 條評論