mình đang tạo form giao diện trên C++ copy code trên trang networkingprogramming
code ntn:
#include <afxwin.h> //MFC core and standard components
#include "resource.h" //main symbols
//-----------------------------------------------------------------------------------------
class GAME_FORM : public CDialog
{
public:
GAME_FORM(CWnd* pParent = NULL): CDialog(GAME_FORM::IDD, pParent)
{ }
enum{IDD = INTERFACE1};
protected:
virtual void DoDataExchange(CDataExchange* pDX) { CDialog:oDataExchange(pDX); }
virtual BOOL OnInitDialog()
{
CDialog::OnInitDialog();
return TRUE;
}
public:
DECLARE_MESSAGE_MAP()
};
//-----------------------------------------------------------------------------------------
class TheGame : public CWinApp
{
public:
TheGame() { }
public:
virtual BOOL InitInstance()
{
CWinApp::InitInstance();
GAME_FORM dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
return FALSE;
} //close function
};
//-----------------------------------------------------------------------------------------
//Need a Message Map Macro for both CDialog and CWinApp
BEGIN_MESSAGE_MAP(GAME_FORM, CDialog)
END_MESSAGE_MAP()
//-----------------------------------------------------------------------------------------
TheGame theApp; //Starts the Application
BẠN NÀO TÌM GIÚP MÌNH LỖI VỚI.
THANKS!!!
code ntn:
#include <afxwin.h> //MFC core and standard components
#include "resource.h" //main symbols
//-----------------------------------------------------------------------------------------
class GAME_FORM : public CDialog
{
public:
GAME_FORM(CWnd* pParent = NULL): CDialog(GAME_FORM::IDD, pParent)
{ }
enum{IDD = INTERFACE1};
protected:
virtual void DoDataExchange(CDataExchange* pDX) { CDialog:oDataExchange(pDX); }
virtual BOOL OnInitDialog()
{
CDialog::OnInitDialog();
return TRUE;
}
public:
DECLARE_MESSAGE_MAP()
};
//-----------------------------------------------------------------------------------------
class TheGame : public CWinApp
{
public:
TheGame() { }
public:
virtual BOOL InitInstance()
{
CWinApp::InitInstance();
GAME_FORM dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
return FALSE;
} //close function
};
//-----------------------------------------------------------------------------------------
//Need a Message Map Macro for both CDialog and CWinApp
BEGIN_MESSAGE_MAP(GAME_FORM, CDialog)
END_MESSAGE_MAP()
//-----------------------------------------------------------------------------------------
TheGame theApp; //Starts the Application
BẠN NÀO TÌM GIÚP MÌNH LỖI VỚI.
THANKS!!!