myTicTac.hclass CMyApp : public CWinApp
{
public:
    virtual BOOL InitInstance ();
virtual BOOL ExitInstance();
};class CMainWindow : public CWnd
{public:
    CMainWindow ();protected:
   // virtual void PostNcDestroy ();    afx_msg void OnPaint ();
    DECLARE_MESSAGE_MAP ()
};
---------------------------------------------------------------
//myTicTac.cpp
#include <afxwin.h>
#include "myTicTac.h"CMyApp myApp;/////////////////////////////////////////////////////////////////////////
// CMyApp member functionsBOOL CMyApp::InitInstance ()
{
    m_pMainWnd = new CMainWindow;
    m_pMainWnd->ShowWindow (m_nCmdShow);
    m_pMainWnd->UpdateWindow ();
    return TRUE;
}/////////////////////////////////////////////////////////////////////////
// CMainWindow message map and member functionsBEGIN_MESSAGE_MAP (CMainWindow, CWnd)
    ON_WM_PAINT ()
    ON_WM_LBUTTONDOWN ()
    ON_WM_LBUTTONDBLCLK ()
    ON_WM_RBUTTONDOWN ()
END_MESSAGE_MAP ()CMainWindow::CMainWindow ()
{
       CString strWndClass = AfxRegisterWndClass (
        CS_DBLCLKS, // Class style
        AfxGetApp ()->LoadStandardCursor (IDC_CROSS),   // Class cursor
        (HBRUSH) ( COLOR_3DFACE + 1), // Background brush
        AfxGetApp ()->LoadStandardIcon (IDI_WINLOGO) // Class icon
    ); RECT r;
r.left = 50;
r.right = 400;
r.top =50;
r.bottom=400;
    CreateEx(0, strWndClass, _T ("Tic-Tac-Toe"),
    WS_SYSMENU  , r, NULL,NULL);
 
}
BOOL CMyApp::ExitInstance()
{
// AfxMessageBox("in");
delete m_pMainWnd;
    return TRUE;
}void CMainWindow::OnPaint ()
{
   
   
}