資源簡介
MFC的五子棋的程序
功能:
1)本地雙人游戲
2) 網絡對戰
3) 本地簡單人機游戲
4) 請求悔棋,和棋
注:背景圖為QQ游戲五子棋的背景圖

代碼片段和文件信息
//?Chess.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“Chess.h“
#include?“MainFrm.h“
#include?“ChessDoc.h“
#include?“ChessView.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CChessApp
BEGIN_MESSAGE_MAP(CChessApp?CWinApp)
//{{AFX_MSG_MAP(CChessApp)
ON_COMMAND(ID_APP_ABOUT?OnAppAbout)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code!
//}}AFX_MSG_MAP
//?Standard?file?based?document?commands
ON_COMMAND(ID_FILE_NEW?CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN?CWinApp::OnFileOpen)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CChessApp?construction
CChessApp::CChessApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CChessApp?object
CChessApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CChessApp?initialization
BOOL?CChessApp::InitInstance()
{
//?啟動套接字
WSADATA?wsa;
????if?(WSAStartup(0x101?&wsa))
{
AfxMessageBox(“套接字初始化錯誤!“?NULL?MB_OK?|?MB_IConstop);
????WSACleanup();
????return?FALSE;
}???
????if?(LOBYTE(wsa.wVersion)?!=?1?||?HIBYTE(wsa.wVersion)?!=?1)
{
?????? AfxMessageBox(“版本匹配錯誤!“?NULL?MB_OK?|?MB_IConstop);
????WSACleanup();
????return?FALSE;
}
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
//?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“));
LoadStdProfileSettings();??//?Load?standard?INI?file?options?(including?MRU)
//?Register?the?application‘s?document?templates.??Document?templates
//??serve?as?the?connection?between?documents?frame?windows?and?views.
CSingleDocTemplate*?pDocTemplate;
pDocTemplate?=?new?CSingleDocTemplate(
IDR_MAINframe
RUNTIME_CLASS(CChessDoc)
RUNTIME_CLASS(CMainframe)???????//?main?SDI?frame?window
RUNTIME_CLASS(CChessView));
AddDocTemplate(pDocTemplate);
//?Parse?command?line?for?standard?shell?commands?DDE?file?open
CCommandLineInfo?cmdInfo;
ParseCommandLine(cmdInfo);
//?Dispatch?commands?specif
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????2260252??2015-01-08?20:04??MFC五子棋\Chess.aps
?????文件???????2853??2015-01-08?20:04??MFC五子棋\Chess.clw
?????文件???????4463??2014-02-08?22:45??MFC五子棋\Chess.cpp
?????文件???????5546??2014-02-08?22:57??MFC五子棋\Chess.dsp
?????文件????????518??2014-01-23?13:51??MFC五子棋\Chess.dsw
?????文件???????1345??2014-01-23?13:51??MFC五子棋\Chess.h
?????文件?????230400??2015-01-08?20:04??MFC五子棋\Chess.ncb
?????文件??????55808??2015-01-08?20:04??MFC五子棋\Chess.opt
?????文件????????931??2015-01-08?20:04??MFC五子棋\Chess.plg
?????文件??????12043??2015-01-08?20:04??MFC五子棋\Chess.rc
?????文件???????1722??2014-01-23?13:51??MFC五子棋\ChessDoc.cpp
?????文件???????1464??2014-01-23?13:51??MFC五子棋\ChessDoc.h
?????文件??????24760??2014-02-10?23:20??MFC五子棋\ChessView.cpp
?????文件???????3892??2014-02-10?12:31??MFC五子棋\ChessView.h
?????文件???????1174??2014-02-08?21:57??MFC五子棋\DialogJoin.cpp
?????文件???????1241??2014-02-08?21:57??MFC五子棋\DialogJoin.h
?????文件???????1022??2014-02-08?20:53??MFC五子棋\DialogWait.cpp
?????文件???????1260??2014-02-08?20:53??MFC五子棋\DialogWait.h
?????文件???????3777??2014-02-09?15:13??MFC五子棋\MainFrm.cpp
?????文件???????1499??2014-02-09?15:08??MFC五子棋\MainFrm.h
?????文件???????3973??2014-01-23?13:51??MFC五子棋\ReadMe.txt
?????文件??????92150??2014-01-23?13:54??MFC五子棋\res\10.ico
?????文件????1276630??2014-02-10?16:47??MFC五子棋\res\ackground.bmp
?????文件???????3354??2014-02-08?14:48??MFC五子棋\res\black(1).bmp
?????文件????????818??2014-02-08?14:56??MFC五子棋\res\bmp00001.bmp
?????文件????????818??2014-02-08?15:00??MFC五子棋\res\bmp00002.bmp
?????文件????????397??2014-01-23?13:51??MFC五子棋\res\Chess.rc2
?????文件?????840106??2014-02-08?14:26??MFC五子棋\res\chessboard.bmp
?????文件???????3354??2014-02-08?14:46??MFC五子棋\res\white(-1).bmp
?????文件???????1597??2014-02-09?16:04??MFC五子棋\resource.h
............此處省略8個文件信息
- 上一篇:傳教士野人渡河帶界面
- 下一篇:離散數學實驗 C語言編程
評論
共有 條評論