fatal error C1010: unexpected end of file while looking for precompiled header directive如何改啊?急

来源:百度知道 编辑:UC知道 时间:2024/05/31 03:29:52
代码如下:
recource.h中是可视化操作自动生成的
//MyDialog.h
#include <afxwin.h>
#include <afxcmn.h> //为了使用CStatusBarCtrl类

class CMyApp : public CWinApp
{
public:
BOOL InitInstance( );

};

class CMonitorDialog : public CDialog
{
public:
CMonitorDirDialog(CWnd* pParentWnd = NULL);
~CMonitorDirDialog();
};
//MyDialog.cpp
#include "MyDialog.h"
#include "resource.h"

CMyApp theApp;

BOOL CMyApp::InitInstance()
{
CMonitorDialog dlg;
m_pMainWnd = &dlg;
dlg.DoModal();
return FALSE; //返回FALSE阻止线程进入消息循环
}

CMonitorDialog::CMonitorDirDialog(CWnd* pParentWnd):CDialog(IDD_MAINDIALOG,pParentWnd)
{
m_hEvent = ::CreateEvent(NULL,FALSE,0,NULL);
}

CMonitorDialog::~CMonitorDialog()
{
::Close(m_hEvent);
}
在那地方设置呀,还望高手指明

预编译头文件的问题,在预编译选项里去掉这个选项,或者加上
#include "stdafx.h"
我用的是VC2005,在工程属性、配置属性、C/C++、预编译头文件里面的创建使用头文件一项选择不使用预编译头文件就可以了,其他编译器的话你到类似的地方找找吧~

CPP文件的最前面加上

#include "stdafx.h"
一定要在最前面加。

你的:
#include <afxwin.h>
#include <afxcmn.h>
也挪到 stdafx.h文件中去