CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
IBM Rational 系统开发最佳实践工具包 WebSphere MQ 最佳实践 TOP 15
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  基础类

编译不提示出错,运行出现abnormal program termintion

楼主lisypro()2006-03-06 08:52:01 在 VC/MFC / 基础类 提问

编译不提示出错,运行出现abnormal   program   termintion   .  
  原程序如下  
  //   cf.cpp   :   Defines   the   entry   point   for   the   console   application.  
  //  
   
  #include   "stdafx.h"  
  #include   "cf.h"  
   
  #ifdef   _DEBUG  
  #define   new   DEBUG_NEW  
  #undef   THIS_FILE  
  static   char   THIS_FILE[]   =   __FILE__;  
  #endif  
   
  /////////////////////////////////////////////////////////////////////////////  
  //   The   one   and   only   application   object  
   
  CWinApp   theApp;  
   
  using   namespace   std;  
   
  int   _tmain(int   argc,   TCHAR*   argv[],   TCHAR*   envp[])  
  {  
  int   nRetCode   =   0;  
   
   
  //   initialize   MFC   and   print   and   error   on   failure  
  if   (!AfxWinInit(::GetModuleHandle(NULL),   NULL,   ::GetCommandLine(),   0))  
  {  
  //   TODO:   change   error   code   to   suit   your   needs  
  cerr   <<   _T("Fatal   Error:   MFC   initialization   failed")   <<   endl;  
  nRetCode   =   1;  
  }  
  else  
  {  
  //   TODO:   code   your   application's   behavior   here.  
  CString   strTemp;  
  CFile   mFile;  
  cout   <<"1sd";  
  if(mFile.Open("d:\\1.txt",CFile::modeRead)==0)  
  {  
  cout   <<"sd";  
  return   0;  
  }  
   
  CArchive   ar(&mFile,CArchive::load);  
  ar   >>   strTemp;//本语句处   出错,但编译不出错。  
  cout   <<   "22";//本语句未能正常输出  
   
   
  ar.Close();  
  mFile.Close();  
  cout   <<   strTemp;  
  }  
   
  return   nRetCode;  
  }  
  问题点数:20、回复次数:5Top

1 楼lisypro()回复于 2006-03-06 13:44:56 得分 0

这个程序哪里出错了怎么改呀?Top

2 楼syy64(太平洋)回复于 2006-03-06 13:58:26 得分 20

调试,看哪一行出错。Top

3 楼lisypro()回复于 2006-03-08 09:20:34 得分 0

就是这一行出错Top

4 楼lisypro()回复于 2006-03-09 10:17:02 得分 0

ar   >>   strTemp;//本语句处   出错,但编译不出错。Top

5 楼lisypro()回复于 2006-03-10 16:49:27 得分 0

为会知道   为什么码Top

相关问题

  • 编译出错
  • 编译出错??
  • 编译出错!!
  • 编译出错
  • 编译时出错?
  • fieldsbyname 编译出错
  • dll编译出错~~
  • PB编译出错
  • dll编译出错
  • vb编译出错

关键词

  • 出错

得分解答快速导航

  • 帖主:lisypro
  • syy64

相关链接

  • Visual C++类图书
  • Visual C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo