c++代码(五子棋)
来源:互联网 发布:淘宝店铺升级企业后 编辑:程序博客网 时间:2024/05/16 08:58
// Five.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "Five.h"
#include "FiveDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFiveApp
BEGIN_MESSAGE_MAP(CFiveApp, CWinApp)
//{{AFX_MSG_MAP(CFiveApp)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CFiveApp construction
CFiveApp::CFiveApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CFiveApp object
CFiveApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CFiveApp initialization
BOOL CFiveApp::InitInstance()
{
if (!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return FALSE;
}
// 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
// 获得配置文件位置
::GetModuleFileName( NULL, m_szIni, MAX_PATH );
lstrcpy( &m_szIni[lstrlen( m_szIni ) - 3], _T("ini") );
// 读取战绩统计
m_nWin = ::GetPrivateProfileInt( _T("Stats"), _T("Win"), 0, m_szIni );
m_nDraw = ::GetPrivateProfileInt( _T("Stats"), _T("Draw"), 0, m_szIni );
m_nLost = ::GetPrivateProfileInt( _T("Stats"), _T("Lost"), 0, m_szIni );
// 注册棋盘窗口类
WNDCLASS wc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hbrBackground = (HBRUSH)GetStockObject( WHITE_BRUSH );
wc.hCursor = LoadCursor( IDC_ARROW );
wc.hIcon = NULL;
wc.hInstance = AfxGetInstanceHandle();
wc.lpfnWndProc = ::DefWindowProc;
wc.lpszClassName = _T("ChessTable");
wc.lpszMenuName = NULL;
wc.style = 0;
AfxRegisterClass( &wc );
CFiveDlg 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;
}
- C语言实现五子棋代码
- 五子棋人机互弈代码 C
- 五子棋代码
- 用c语言代码编写的游戏“简易五子棋”
- 五子棋服务器端代码
- 五子棋客户端代码
- java五子棋游戏 代码
- c++代码(五子棋)
- 五子棋代码解析
- 一个五子棋代码
- j2me 五子棋代码啊
- 网络五子棋代码
- 五子棋C++代码
- 【java】双人五子棋代码
- 五子棋代码详细注解
- 五子棋的小代码
- VB.Net五子棋代码
- C语言五子棋算法
- CUDA
- 工作幾年之後的痛
- 关于CWinApp::OnIdle的解释
- MySQL查询某个字段不重复的所有记录
- 常用JavaScript
- c++代码(五子棋)
- 寄存器,触发器,锁存器之间的区别与联系
- 谁有hibernate 方面的电子书推荐一下!谢谢!
- [转]ANT 命令总结
- 开关电源和线性电源的区别
- 触发器,存储过程返回值
- C# 硬盘分区计算器
- 上拉电阻和下拉电阻的作用
- 模糊数学基础(1)