资源简介
删除了debug,文件小点,自己运行下实例就好。
运行很简单,先运行chess服务器实例,点击联机。然后运行客户端输入ip,点击链接主机。黑棋由服务器端先下。
各种闪屏等bug都处理掉了,废了一点力的。。。AI和保存棋局还没加入,下次我会做个高级点的AI算法一起上传,这次就先传网络对战的。
10分好少啊,想要20分的(客户端,服务器分开传就有20分了,O(∩_∩)O哈哈)想想你们不方便就算了,嘿。。。
代码片段和文件信息
// 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)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP CWinApp::OnFilePrintSetup)
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()
{
if (!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
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);
// Enable DDE Execute open
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// Parse command line for standard shell commands DDE file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALS 属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 44888 2011-10-25 21:17 五子棋\chess\chess.aps
文件 2654 2011-11-05 18:16 五子棋\chess\chess.clw
文件 4431 2011-10-25 14:50 五子棋\chess\chess.cpp
文件 4596 2011-10-25 14:50 五子棋\chess\chess.dsp
文件 730 2011-11-04 15:37 五子棋\chess\chess.dsw
文件 1345 2011-10-25 14:50 五子棋\chess\chess.h
文件 123904 2011-11-05 19:29 五子棋\chess\chess.ncb
文件 66048 2011-11-05 19:29 五子棋\chess\chess.opt
文件 244 2011-11-05 18:06 五子棋\chess\chess.plg
文件 1321 2011-11-05 19:29 五子棋\chess\chess.positions
文件 12400 2011-10-25 21:17 五子棋\chess\chess.rc
文件 1722 2011-10-25 14:50 五子棋\chess\chessDoc.cpp
文件 1464 2011-10-25 14:50 五子棋\chess\chessDoc.h
文件 13752 2011-11-04 18:14 五子棋\chess\chessView.cpp
文件 2866 2011-11-04 17:27 五子棋\chess\chessView.h
文件 2738 2011-10-25 19:42 五子棋\chess\MainFrm.cpp
文件 1581 2011-10-25 14:50 五子棋\chess\MainFrm.h
文件 4576 2011-10-25 14:50 五子棋\chess\ReadMe.txt
文件 1078 2011-10-25 14:50 五子棋\chess\res\chess.ico
文件 397 2011-10-25 14:50 五子棋\chess\res\chess.rc2
文件 1078 2011-10-25 14:50 五子棋\chess\res\chessDoc.ico
文件 1078 2011-10-25 14:50 五子棋\chess\res\Toolbar.bmp
文件 958 2011-10-25 21:17 五子棋\chess\resource.h
文件 207 2011-10-25 14:50 五子棋\chess\StdAfx.cpp
文件 1102 2011-10-25 14:50 五子棋\chess\StdAfx.h
文件 45336 2011-11-05 18:18 五子棋\chessclient\chessclient.aps
文件 2872 2011-11-05 18:24 五子棋\chessclient\chessclient.clw
文件 4539 2011-10-26 11:48 五子棋\chessclient\chessclient.cpp
文件 4728 2011-10-26 11:48 五子棋\chessclient\chessclient.dsp
文件 724 2011-10-26 11:54 五子棋\chessclient\chessclient.dsw
............此处省略27个文件信息
- 上一篇:Elgamal算法,加密算法,各算法比较
- 下一篇:移动的球体MFC制作
相关资源
- 基于MFC的TCP调试助手源码95706
- 基于mfc的多线程文件传输
- C++多线程网络编程Socket
- MFC数字钟(基于VC6.0)
- VC++MFC小游戏实例教程(实例)+MFC类库
- c语言看发的网络协议 ,源代码
- 基于C语言实现的网络爬虫(搜索引擎
- ChartCtrl控件库(可在VS2019中使用)
- 商品库存管理系统 C++ MFC
- mfc 调用redis
- windows网络编程_文件传输
- MFC视频播放器源码(支持avi/wma/mp3等格
- mfc绘图大全(画直线、矩形、椭圆)
- MFC控件重绘
- hook,捕获所有案件,查找所有窗口,
- (学习)VS2010之MFC入门到精通教程
- 西北大学2015年计算机网络复试真题回
- MFC文档_视图_框架_模板结构体系深入
- 简单员工管理系统(适合初学MFC)
- 五子棋游戏源码(控制台)
- 五子棋c++控制台代码
- MFC五子棋游戏
- MFC UDP编程
- MFC的异步网络通讯应用程序
- C++MFC模块讲解,黑发程序员课程整理
- 一个简单而强大的基于MFC的web server源
- 基于MFC的VC++仿QQ浏览器源码(雏形)
- MFCaccess.rar
- VC++MFC课程设计的学生成绩管理系统
- MFC 日历控件 万年历 Calendar自绘
川公网安备 51152502000135号
评论
共有 条评论