有一段程序,老是提示下面的错误,请大侠指点
MFC.CPP
f:\vc6\hmfc\mfc.cpp(8) : fatal error C1010:
unexpected end of file while looking for precompiled header directive
MY.CPP
f:\vc6\hmfc\my.cpp(9) : fatal error C1010:
unexpected end of file while looking for precompiled header directive
////////////////////////////////////////////
// MFC.cpp
#include "my.h"extern CMyWinApp theApp;
CWinApp* AfxGetApp()
{
return theApp.m_pCurrentWinApp ;
}/////////////////////////////////////////////
// MFC.h
#include<iostream.h>
class CWinApp
{
public:
CWinApp* m_pCurrentWinApp;
CWinApp::CWinApp()
{ cout << "CWinApp Constructor\n";}
CWinApp::~CWinApp()
{ cout << "CWinApp Destructor\n";}
};//global function
CWinApp* AfxGetApp();
////////////////////////////////////////////////
// My.Cpp
#include "My.h"
#include<iostream.h>
CMyWinApp theApp;void main()
{
CWinApp* pApp = AfxGetApp();
}///////////////////////////////////////////////////
// My.h
#include "mfc.h"class CMyWinApp:public CWinApp
{
public:
CMyWinApp::CMyWinApp(){ cout << "CMyWinApp Constructor\n";}
CMyWinApp::~CMyWinApp(){ cout << "CMyWinApp Destructor\n";}
}
MFC.CPP
f:\vc6\hmfc\mfc.cpp(8) : fatal error C1010:
unexpected end of file while looking for precompiled header directive
MY.CPP
f:\vc6\hmfc\my.cpp(9) : fatal error C1010:
unexpected end of file while looking for precompiled header directive
////////////////////////////////////////////
// MFC.cpp
#include "my.h"extern CMyWinApp theApp;
CWinApp* AfxGetApp()
{
return theApp.m_pCurrentWinApp ;
}/////////////////////////////////////////////
// MFC.h
#include<iostream.h>
class CWinApp
{
public:
CWinApp* m_pCurrentWinApp;
CWinApp::CWinApp()
{ cout << "CWinApp Constructor\n";}
CWinApp::~CWinApp()
{ cout << "CWinApp Destructor\n";}
};//global function
CWinApp* AfxGetApp();
////////////////////////////////////////////////
// My.Cpp
#include "My.h"
#include<iostream.h>
CMyWinApp theApp;void main()
{
CWinApp* pApp = AfxGetApp();
}///////////////////////////////////////////////////
// My.h
#include "mfc.h"class CMyWinApp:public CWinApp
{
public:
CMyWinApp::CMyWinApp(){ cout << "CMyWinApp Constructor\n";}
CMyWinApp::~CMyWinApp(){ cout << "CMyWinApp Destructor\n";}
}
解决方案 »
- 文本文档写数据问题
- 还是窗口的切分问题,这是我第三次提问了,谁回答正确,把我的分给他一半!
- unicode工程迁移(高分)
- 从“DWORD”转换为“LPCTSTR”
- UDP心跳报文的接收问题
- CScrollView中ScrollBar的滚动问题
- 怎样非法获取PASSWORD(关于WM_MOUSEMOVE消息的响应函数)
- 请大家帮忙:一个简单问题 ! 急
- 关于服务器程序同时收到多个客户端数据的问题?
- 谁可以给我一个提示,到那里可以找到”xml数据完整性检查“的源代码,最好是vc的,如果有大虾知道,mail:zhb03272sina.com,谢谢。
- 关于PeekNamedPipe的问题??
- winnt下如何显示出所有正在运行的本机进程
#include "stdafx.h"
stdafx.h 头文件, 否则就会出现你的那个错误
f:\vc6\hmfc\mfc.cpp(2) :
fatal error C1083: Cannot open precompiled header file: 'Debug/Hmfc.pch': No such file or directory
MY.CPP
f:\vc6\hmfc\my.cpp(9) :
fatal error C1010: unexpected end of file while looking for Hmfc.exe - 3 error(s), 1 warning(s)