[求助]使用VS2005写一个简单的MFC,可是却提示说0x78260a88 (mfc80d.dll) 处未处理的异常
发表于:2008-01-22 10:05:33 楼主
#include <afxwin.h>
class C0201App:public CWinApp
{
public:
virtual BOOL InitInstance();
};
class C0201Window:public CFrameWnd
{
public:
C0201Window();
DECLARE_MESSAGE_MAP()
public:
void OnPaint();
};
C0201Window::C0201Window()
{
Create(NULL,"Windows编程技术第2章例1");
}
BOOL C0201App::InitInstance()
{
m_pMainWnd=new C0201Window;
m_pMainWnd-> ShowWindow(m_nCmdShow);
m_pMainWnd-> UpdateWindow();
return TRUE;
}
BEGIN_MESSAGE_MAP(C0201Window,CFrameWnd)
ON_WM_PAINT()
END_MESSAGE_MAP()
void C0201Window::OnPaint()
{
PAINTSTRUCT ps;
HDC hdc;
hdc=::BeginPaint(m_hWnd,&ps);
::TextOut(hdc,100,100,"手工编写的MFC程序!",lstrlen("手工的编写MFC程序"));
::EndPaint(m_hWnd,&ps);
}
===============================
VS2005下写这个MFC,可是却提示:
0201.exe中的 0x78260a88 (mfc80d.dll) 处未处理的异常:
0xC0000005:读取位置0x000000时发生访问冲突
另外,在winmain.cpp文件里好象到了
if (!pThread-> InitInstance())
这句提示错误信息,并让选择是否中断或继续的
请问这是怎么回事