CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  基础类

程序在Debug下没问题一到Release下就运行不了。。。。谁遇过这样的问题?

楼主nightfallrove(过儿 明月装饰了你的窗 你装饰了我的梦)2004-05-04 19:31:01 在 VC/MFC / 基础类 提问

程序在Debug下没有任何问题,但是一到Release下就会在InitInstance函数的  
  if(!pMainFrame->LoadFrame(IDR_MAINFRAME))  
        return   false;  
  上面这句会返回false,导致InitInstance失败,程序退出。。。。  
  这是为什么?  
  怎么会在Release下面的时候LoadFrame(IDR_MAINFRAME)失败呢?  
  在Debug下面是没有问题的。。。。 问题点数:50、回复次数:14Top

1 楼cmx98(尘世中一个迷途小书僮)回复于 2004-05-04 20:18:46 得分 0

近来怪事一箩筐啊Top

2 楼subtop(南来北往)回复于 2004-05-04 20:29:49 得分 0

关注...Top

3 楼opentuxedo(借哥哥的号来试试)回复于 2004-05-04 20:34:23 得分 0

跟踪到LoadFrame函数中去看看到底在哪句上出的问题。Top

4 楼nightfallrove(过儿 明月装饰了你的窗 你装饰了我的梦)回复于 2004-05-04 20:37:54 得分 0

是MDI程序  
  改了InitInstance里面的东西:  
  把那个MultiDocTemplate删了  
  在InitInstance里面创建了好多自己定义的文档模板Top

5 楼wishare(那一年)回复于 2004-05-04 21:11:45 得分 0

所以说我们还是要在RELEASE下写东西千万不要在DEBUG下写。Top

6 楼zhuyie()回复于 2004-05-04 22:44:57 得分 0

这类事情太正常了,Release版调试是很令人头痛的。Top

7 楼nightfallrove(过儿 明月装饰了你的窗 你装饰了我的梦)回复于 2004-05-05 13:52:24 得分 0

opentuxedo(开缝的燕尾服)   (   ):  
  没办法跟踪LoadFrame啊,,,  
  Debug下没事,,,但Release下不能跟宗调试的。。。。  
  我把那些文档模板注销了还是不行。。。。  
  Top

8 楼szclm(IT的民工)回复于 2004-05-05 14:02:23 得分 10

你的MainFrame初始化出现问题,比如MainFrame中的对像初始化出现了异常!  
   
  在Debug下对一些可能出现的问题是做了优化的!  
   
  你着手看看你的程序中的所有对像初始化!或是一种系统对像的引用,这都是会产生这样的问题!  
   
  Top

9 楼FengYuanMSFT((6.4 被封杀)袁峰 http://fengyuancom.spaces.live.com)回复于 2004-05-05 15:07:17 得分 0

You   can   enable   debugging   in   release   mode   too.   Then   you   can   step   through   your   code.  
   
  My   impression   is   that   there   is   a   compiler   option   for   debugging   and   there   is   a   linker   option   for   debugging.   Enable   both.  
   
  Step   through   your   code   in   release   mode.Top

10 楼nightfallrove(过儿 明月装饰了你的窗 你装饰了我的梦)回复于 2004-05-05 15:19:24 得分 0

there   is   a   compiler   option   for   debugging   and   there   is   a   linker   option   for   debugging.   Enable   both.  
   
  ///////////////////////////////  
  怎么设置,,,  
  没这样用过。。Top

11 楼comshowboy()回复于 2004-05-05 23:48:41 得分 0

关注……Top

12 楼FengYuanMSFT((6.4 被封杀)袁峰 http://fengyuancom.spaces.live.com)回复于 2004-05-06 04:51:58 得分 40

Enable   debugging   for   release   build   (   Visual   Studio   7   ):  
   
  1.   Click   View   on   the   main   menu  
  2.   Solution   Explorer.  
  3.   Right   moust   clik   on   EXE   project.  
  4.   Properties.  
  5.   Configuration   Properties     /   C/C++   /   General,   change   Debug   Information   Format   from   Disabled   to   Program   Database.  
  6.   Configuration   Properties   /   Linker   /   Debug,   change   Generate   Debug   info   from   No   to   Yes.  
  7.   Perform   5   and   6   for   all   the   LIB   and   DLL   you   want   to   debug   in   your   workspace.  
  8.   Rebuild.  
  9.   Debug   your   release   code.  
   
  www.fengyuan.comTop

13 楼nightfallrove(过儿 明月装饰了你的窗 你装饰了我的梦)回复于 2004-05-06 14:15:14 得分 0

谢谢FengYuanMSFT(袁峰)    
  我的是VC6,我把Project->seting....里面的Debug页的一些设置改了一下  
  后就没问题了,我也不知道为什么。。。Top

14 楼FengYuanMSFT((6.4 被封杀)袁峰 http://fengyuancom.spaces.live.com)回复于 2004-05-06 14:26:54 得分 0

You   may   still   have   uninitialized   variable   somewhere,   or   heap/stack   corruption.  
   
  Add   some   heap   checking   code   to   your   program.Top

相关问题

  • debug程序不能运行?????
  • 100分!求教:Debug换成Release时程序不运行
  • 程序在debug时运行正确,在release时出现错误?
  • 调试问题,为什麽程序在debug 版下运行正常, 但release 版运行不正常
  • 为什么我的程序Debug运行没问题,Release运行的时候出错了?
  • 高分请教,程序debug下运行正常.release下运行不正常一般是什么问题啊?
  • 为什么我的程序在debug版运行良好,而release版出错?
  • 为什么程序的debug版不能运行而release版则可以?
  • 请问release版本可运行的程序,改成debug后为何出错?
  • 编译成debug程序运行正常,但编译成release程序一执行就退出了

关键词

  • debug
  • release
  • code
  • 程序
  • loadframe
  • 问题
  • 初始化
  • initinstance
  • mainframe
  • linker

得分解答快速导航

  • 帖主:nightfallrove
  • szclm
  • FengYuanMSFT

相关链接

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

广告也精彩

反馈

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