菜鸟MFC 求指导
我想学windows应用编程,着两天看了哈mfc在书上抄了这个程序想试试运行科遇到的错误提示是这样的
“--------------------Configuration: test5 - Win32 Debug--------------------
Compiling...
t5_hello.cpp
D:\vc++6.0\vc\test5\t5_hello.cpp(7) : error C2504: 'CWinApp' : base class undefined
D:\vc++6.0\vc\test5\t5_hello.cpp(19) : error C2504: 'CFrameWnd' : base class undefined
D:\vc++6.0\vc\test5\t5_hello.cpp(20) : error C2143: syntax error : missing ';' before '*'
D:\vc++6.0\vc\test5\t5_hello.cpp(20) : error C2501: 'CStatic' : missing storage-class or type specifiers
D:\vc++6.0\vc\test5\t5_hello.cpp(20) : error C2501: 'cs' : missing storage-class or type specifiers
D:\vc++6.0\vc\test5\t5_hello.cpp(29) : error C2065: 'm_pMainWnd' : undeclared identifier
D:\vc++6.0\vc\test5\t5_hello.cpp(29) : error C2061: syntax error : identifier 'CHelloWindow'
D:\vc++6.0\vc\test5\t5_hello.cpp(30) : error C2227: left of '->ShowWindow' must point to class/struct/union
D:\vc++6.0\vc\test5\t5_hello.cpp(30) : error C2065: 'm_nCmdShow' : undeclared identifier
D:\vc++6.0\vc\test5\t5_hello.cpp(31) : error C2227: left of '->UpdateWindow' must point to class/struct/union
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : error C2143: syntax error : missing ';' before '}'
................................
D:\vc++6.0\vc\test5\t5_hello.cpp(33) : fatal error C1003: error count exceeds 100; stopping compilation
执行 cl.exe 时出错.”全是
BOOL CHelloApp::InitInstance()
{
m_pMainWnd = new CHelloWindow();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}里的出错,因为新手不知道怎么搞。请大神们知道哈,下面是抄的代码。谢谢啊!
t5_hello.obj - 1 error(s), 0 warning(s)
//hello.cpp
#include <afxwin.h>
#include <stdafx.h>
//说明应用程序类
class CHelloApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};
//建立应用程序类的应用
CHelloApp HelloApp;
//说明主窗口类
class CHwlloWindow : public CFrameWnd
{
CStatic* cs;
public:
CHelloWindow();
};
//每当应用程序首次执行时都要调用的初始化函数
//窗口类的构造函数
CHelloWindow::CHelloWindow()
{
//建立窗口本身
Create(NULL,"hello Woeld!",WS_OVERLAPPEDWINDOW,CRect(0,0,200,200));
//建立静态标签
cs = new CStatic();
cs->Create("hello world",WS_CHILD|WS_VISIBLE|SS_CENTER,CReate(50,80,150,150),this);
}