救救我的五子棋程序啊
sms88 2006-05-30 08:41:10 为何我一单击鼠标左键就会 系统没有反应 .我只能强制关电源重启了.
我的程序是参考<<MFC windows程序设计>> 中的第三章 改编出来的
//TicTac.h
#define EX 1
#define OH 2
class com
{
public:
com(int i=0, int j=0)
{
m=i;
n=j;
};
int m;
int n;
}; //为了保存的棋子的坐标
class CMyApp : public CWinApp
{
public:
virtual BOOL InitInstance ();
};
class CMainWindow : public CWnd
{
protected:
CRect m_rcSquares[20][20]; // Grid coordinates
int m_nGameGrid[20][20]; // Grid contents
int m_nNextChar; // Next character (EX or OH)
com GetRectID (CPoint & point);
void DrawBoard (CDC* pDC);
void DrawX (CDC* pDC, com & nPos);
void DrawO (CDC* pDC, com & nPos);
void ResetGame ();
void CheckForGameOver ();
int IsWinner ();
BOOL IsDraw ();
public:
CMainWindow ();
protected:
virtual void PostNcDestroy ();
afx_msg void OnPaint ();
afx_msg void OnLButtonDown (UINT nFlags, CPoint point);
afx_msg void OnLButtonDblClk (UINT nFlags, CPoint point);
afx_msg void OnRButtonDown (UINT nFlags, CPoint point);
DECLARE_MESSAGE_MAP ()
};