我才开始学习VC++,看到了一个关于解释MFC应用程序框架的例子.我照着书上抄的.可是不能运行.高手帮着看看...
(写在C++Source File 项下,并在运行前加了,Use MFC in a Shared DLL)
#include<afxwin.h>
class CHelloApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};
CHelloApp theApp;
class CMainFrame : public CFrameWnd
{
public:
CMainFrame()
{
Create(NULL,"Hello World!",WS_OVERLAPPEDWINDOW,CRect(0,0,400,300));
}
protected:
afx_msg void OnLButtonDown(UINT nFlags,CPoint point);
DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(CMainFrame,CFrameWnd)
    ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()
void CMainFrame::OnLButtonDown(UINT nFlags,CPoint point)
{
MessageBox("&Auml;&atilde;&ordm;&Atilde;,&Otilde;&acirc;&Ecirc;&Ccedil;&Icirc;&Ograve;&micro;&Auml;&micro;&Uacute;&Ograve;&raquo;&cedil;&ouml;Visual C++&sup3;&Igrave;&ETH;ò!","Hello");
CFrameWnd::OnLButtonDown(nFlags,point);
}
BOOL CHelloApp::InitInstance()
{
m_pMainWnd=new CMainFrame();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}编译没有问题,运行时有两个错误
msvcrtd.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main
Debug/ExMFC.exe : fatal error LNK1120: 1 unresolved externals