编译通过,建立时出错。错误提示如下:--------------------Configuration: 01 - Win32 Debug--------------------
Linking...
msvcrtd.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main
Debug/01.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.01.exe - 2 error(s), 0 warning(s)
不知何意
源程序如下
#include <afxwin.h>class CHelloAppDlg : public CDialog, public CWinApp
{
public:
CHelloAppDlg()
{ } void* operator new(size_t nSize)
{ return CFrameWnd::operator new(nSize); }
void operator delete(void* p)
{ CFrameWnd::operator delete(p); } virtual BOOL InitInstance(); virtual BOOL OnInitDialog();
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(CHelloAppDlg, CDialog)
ON_WM_PAINT()
END_MESSAGE_MAP()BOOL CHelloAppDlg::OnInitDialog()
{
OnInitDialog();
return true;
}
void CHelloAppDlg::OnPaint()
{
CPaintDC dc(this);
CRect rect;
GetClientRect(rect);
CString s = "Hello, Windows!";
dc.TextOut(rect.right / 2, rect.bottom / 2, s);
}BOOL CHelloAppDlg::InitInstance()
{
DoModal();
return TRUE;
}CHelloAppDlg theHelloAppAndDlg;
Linking...
msvcrtd.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main
Debug/01.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.01.exe - 2 error(s), 0 warning(s)
不知何意
源程序如下
#include <afxwin.h>class CHelloAppDlg : public CDialog, public CWinApp
{
public:
CHelloAppDlg()
{ } void* operator new(size_t nSize)
{ return CFrameWnd::operator new(nSize); }
void operator delete(void* p)
{ CFrameWnd::operator delete(p); } virtual BOOL InitInstance(); virtual BOOL OnInitDialog();
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(CHelloAppDlg, CDialog)
ON_WM_PAINT()
END_MESSAGE_MAP()BOOL CHelloAppDlg::OnInitDialog()
{
OnInitDialog();
return true;
}
void CHelloAppDlg::OnPaint()
{
CPaintDC dc(this);
CRect rect;
GetClientRect(rect);
CString s = "Hello, Windows!";
dc.TextOut(rect.right / 2, rect.bottom / 2, s);
}BOOL CHelloAppDlg::InitInstance()
{
DoModal();
return TRUE;
}CHelloAppDlg theHelloAppAndDlg;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货