我有一个项目,最初是在Microsoft Visual C ++上开发的。NET,版本7.0.9466,并且效果很好。我尝试使用MS 2013运行我的项目,而当我尝试构建项目时,我遇到了这个错误提示:
错误C1010:查找预编译的标头时,文件意外结束。您是否忘记在源中添加“ #include“ stdafx.h””?
我已经做过的一些动作:
#include "stdafx.h".cpp文件的开头#include "stdafx.h"为,#include "../stdafx.h"因为我收到以下错误消息:IntelliSense:无法打开源文件“ stdafx.h”
这是我出现此错误的.cpp文件
#include "../stdafx.h"
#include "timedmsgbox.h"
/////////////////////////////////////////////////////////////////////////
//
// CDlgTimedMessageBox
//
/////////////////////////////////////////////////////////////////////////
CMapPtrToPtr CDlgTimedMessageBox::m_mapTimerIdToClassMe;
CCriticalSection CDlgTimedMessageBox::m_sectMap;
extern BOOL AFXAPI AfxIsDescendant(HWND hWndParent, HWND hWndChild);
// the static one to call the messagebox with one line
UINT CDlgTimedMessageBox::TimedMessageBox(UINT flags, LPCTSTR ptszMessage, LPCTSTR ptszTitle,
DWORD dwTimeout, UINT dDefaultReturn,
LPCTSTR …Run Code Online (Sandbox Code Playgroud)