《VC技术内幕》的一个程序!!!!!
//mycpp.h的头文件
class CMyApp:public CWinApp
{
public:
virtual BOOL InitInstance();
};
class CMyFrame:public CFrameWnd
{
public:
CMyFrame();
protected:
afx_msg void OnLButtonDown(UINT nFlags,CPoint point);
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
};
//my.cpp的文件
#include <afxwin.h>
#include "myapp.h"
CMyApp theApp;
BOOL CMyApp::InitInstance()
{
m_pMainWnd=new CMyFrame();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}
BEGIN_MESSAGE_MAP(CMyFrame,CFrameWnd)
ON_WM_LBUTTONDOWN()
ON_WM_PAINT()
END_MESSAGE_MAP()
CMyFrame::CMyFrame()
{
Create(NULL,"myapp Application");
}
void CMyFrame::OnLButtonDown(UINT nFlags,CPoint point)
{
TRACE("Entering CMyFrame::OnLButtonDown - %lx,%d,%d\n",
(long)nFlags,point.x,point.y);
}
void CMyFrame::OnPaint()
{
CPaintDC dc(this);
dc.TextOut(0,0,"hello,world");
}
为什么连接时不能通过,总是报错如下:
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/1.exe : fatal error LNK1120: 2 unresolved externals