unexpected end of file found
2009-08-25 15:26
351 查看
#include <afxwin.h>
#define IDB_BUTTON 100
class Cbutton3App:public CWinApp
{
public:
virtual BOOL InitInstance();
};
Cbutton3App button3App;
class Cbutton3Window:public CFrameWnd
{
CButton* button;
public:
Cbutton3Window();
afx_msg void HandleButton();
afx_msg void OnSize(UINT ,int ,int );
DECLARE_MESSAGE_MAP()
};
void Cbutton3Window::HandleButton()
{
MessageBeep(-1);
}
void Cbutton3Window::OnSize(UINT nType,int cx,int cy)
{
CRect r;
GetClientRect(&r);
r.InflateRect(-20,-20);
button->MoveWindow(r);
}
BEGIN_MESSAGE_MAP(Cbutton3Window,CFrameWnd)
ON_BN_CLICKED(IDB_BUTTON,HandleButton)
ON_WM_SIZE()
END_MESSAGE_MAP()
BOOL Cbutton3App::InitInstance()
{
m_pMainWnd=new Cbutton3Window();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return true;
}
class Cbutton3Window::Cbutton3Window()
{
CRect r;
Create(NULL,"Cbutton test",WS_OVERLAPPEDWINDOW,CRect(0,0,200,200);
GetClientRect(&r);
r.InflateRect(-20,-20);
button=new CButton();
button->Create("Push me",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,r,this,IDB_BUTTON);
}
编译后提示unexpected end of file found
#define IDB_BUTTON 100
class Cbutton3App:public CWinApp
{
public:
virtual BOOL InitInstance();
};
Cbutton3App button3App;
class Cbutton3Window:public CFrameWnd
{
CButton* button;
public:
Cbutton3Window();
afx_msg void HandleButton();
afx_msg void OnSize(UINT ,int ,int );
DECLARE_MESSAGE_MAP()
};
void Cbutton3Window::HandleButton()
{
MessageBeep(-1);
}
void Cbutton3Window::OnSize(UINT nType,int cx,int cy)
{
CRect r;
GetClientRect(&r);
r.InflateRect(-20,-20);
button->MoveWindow(r);
}
BEGIN_MESSAGE_MAP(Cbutton3Window,CFrameWnd)
ON_BN_CLICKED(IDB_BUTTON,HandleButton)
ON_WM_SIZE()
END_MESSAGE_MAP()
BOOL Cbutton3App::InitInstance()
{
m_pMainWnd=new Cbutton3Window();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return true;
}
class Cbutton3Window::Cbutton3Window()
{
CRect r;
Create(NULL,"Cbutton test",WS_OVERLAPPEDWINDOW,CRect(0,0,200,200);
GetClientRect(&r);
r.InflateRect(-20,-20);
button=new CButton();
button->Create("Push me",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,r,this,IDB_BUTTON);
}
编译后提示unexpected end of file found
相关文章推荐
- vc++ resource.h文件出现“fatal error RC1004: unexpected end of file found”问题 .
- fatal error C1071: unexpected end of file found in comment(Mark ZZ)
- unexpected end of file found
- setjmp函数创建简单任务调度时VC编译出错!fatal error C1004: unexpected end of file found
- fatal error RC1004: unexpected end of file found处理方法
- fatal error C1071: unexpected end of file found in comment
- 总结一些关于fatal error RC1004: unexpected end of file found错误的解决方法
- vc提示unexpected end of file found的原因分析
- vc++ resource.h文件出现“fatal error RC1004: unexpected end of file found”问题
- 使用VC6.0编译C++代码的时候报错:fatal error C1071: unexpected end of file found in comment(Mark ZZ)
- fatal error RC1004: unexpected end of file found
- fatal error C1071: unexpected end of file found in comment
- 使用VC6.0编译C++代码的时候报错:fatal error C1071: unexpected end of file found in comment(Mark ZZ)
- 使用VC6.0编译C++代码的时候报错:fatal error C1071: unexpected end of file found in comment(Mark ZZ)
- fatal error C1004: unexpected end of file found
- unexpected end of file found in comment
- fatal error C1071: unexpected end of file found in comment
- 使用VC6.0编译C++代码的时候报错:fatal error C1071: unexpected end of file found in comment(Mark ZZ)
- VS2008中 .h头文件出现“fatal error RC1004: unexpected end of file found”问题
- Visual C++ fatal error RC1004: unexpected end of file found错误