資源簡介
MFC實現N皇后,能顯示擺放的方案數以及輪流顯示各個方案數

代碼片段和文件信息
//?MainFrm.cpp?:?implementation?of?the?CMainframe?class
//
#include?“stdafx.h“
#include?“NQueenMFC.h“
#include?“MainFrm.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)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code?!
ON_WM_CREATE()
//}}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);
????m_wndDlgbar.Create(?this??IDD_QUEEN??CBRS_ALIGN_RIGHT??AFX_IDW_DIALOGBAR);
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
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2595??2010-12-25?16:49??NQueenMFC\MainFrm.cpp
?????文件???????1607??2010-12-25?16:49??NQueenMFC\MainFrm.h
?????文件??????35164??2011-03-23?22:44??NQueenMFC\NQueenMFC.aps
?????文件???????2734??2011-03-23?22:45??NQueenMFC\NQueenMFC.clw
?????文件???????4263??2010-12-25?16:43??NQueenMFC\NQueenMFC.cpp
?????文件???????4752??2010-12-27?00:57??NQueenMFC\NQueenMFC.dsp
?????文件????????541??2010-12-25?16:43??NQueenMFC\NQueenMFC.dsw
?????文件???????1389??2010-12-25?16:43??NQueenMFC\NQueenMFC.h
?????文件?????181248??2011-03-23?22:45??NQueenMFC\NQueenMFC.ncb
?????文件???????1160??2010-12-27?11:50??NQueenMFC\NQueenMFC.plg
?????文件??????12626??2010-12-27?11:34??NQueenMFC\NQueenMFC.rc
?????文件???????1802??2010-12-25?16:43??NQueenMFC\NQueenMFCDoc.cpp
?????文件???????1508??2010-12-25?16:43??NQueenMFC\NQueenMFCDoc.h
?????文件???????7477??2010-12-27?11:50??NQueenMFC\NQueenMFCView.cpp
?????文件???????2287??2010-12-27?11:44??NQueenMFC\NQueenMFCView.h
?????文件???????4383??2010-12-25?16:43??NQueenMFC\ReadMe.txt
?????文件???????1052??2010-12-27?11:34??NQueenMFC\resource.h
?????文件????????211??2010-12-25?16:43??NQueenMFC\StdAfx.cpp
?????文件???????1054??2010-12-25?16:43??NQueenMFC\StdAfx.h
?????文件???????2602??2010-12-27?10:09??NQueenMFC\res\bitmap1.bmp
?????文件???????1490??2010-12-27?00:42??NQueenMFC\res\bmp00001.bmp
?????文件????????598??2010-12-27?00:56??NQueenMFC\res\bmp00002.bmp
?????文件???????1078??2010-12-25?16:43??NQueenMFC\res\NQueenMFC.ico
?????文件????????401??2010-12-25?16:43??NQueenMFC\res\NQueenMFC.rc2
?????文件???????1078??2010-12-25?16:43??NQueenMFC\res\NQueenMFCDoc.ico
?????文件???????1078??2010-12-25?16:43??NQueenMFC\res\Toolbar.bmp
?????文件??????20782??2010-12-25?23:20??NQueenMFC\Debug\MainFrm.obj
?????文件?????127072??2010-12-27?11:50??NQueenMFC\Debug\NQueenMFC.exe
?????文件?????485912??2010-12-27?11:50??NQueenMFC\Debug\NQueenMFC.ilk
?????文件??????23382??2010-12-25?23:33??NQueenMFC\Debug\NQueenMFC.obj
............此處省略15個文件信息
- 上一篇:基于ITK、VTK與MFC讀取DICOM圖像
- 下一篇:MFC編寫一個交互式繪圖程序
評論
共有 條評論