从VC ++ 6迁移到VS2010后,MFC应用程序崩溃. [英] MFC Application crashes after migrating from VC++6 to VS2010.

查看:100
本文介绍了从VC ++ 6迁移到VS2010后,MFC应用程序崩溃.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我已经将我的c ++ mfc应用程序从VC ++ 6移植到了VS2010.解决警告和少量更正后,应用程序正在运行,并且可以打开所有对话框.但是在单击命令按钮,组合框等后,它崩溃了.请让我知道这种行为的可能原因.
在此先感谢,
Ravi

Recently i have ported my c++ mfc application from VC++6 to VS2010. After resolving warning and few corrections, application is running and able to open all dialogs. But it crashes after clicking on the command buttons, combo boxes etc. Please let me know what could be the reason for this behaviour.

Thanks in Advance,
Ravi

推荐答案

VC6和VS2010之间的差异之一在于DEP兼容性. VS2005及更高版本中的所有内容都会创建DEP兼容代码.如果您的代码依赖于不兼容DEP的旧库,而您刚编译的代码则兼容DEP,那么您将遇到奇怪的随机崩溃.

如果要检查可能是DEP兼容性问题,可以使用editbin实用程序删除DEP检查.

例如:
editbin/NXCOMPAT:NO Your.exe
One of the differences between VC6 and VS2010 is in DEP compatibility. Everything from VS2005 and above creates DEP compatible code. If your code is relying on older libraries that aren''t DEP compatible and your freshly compiled code is DEP compatible then you are going to have weird random crashes.

If you want to check that DEP compatibility might be the problem them use the editbin utility to remove DEP checking

ex:
editbin /NXCOMPAT:NO Your.exe


在您的问题中,您给出的详细信息太少,无法很好地进行诊断.

第一步,我建议您在调试"配置中构建项目,然后在调试器中启动它.然后重现崩溃,可能您会在调试器中看到发生了什么. MFC中许多ASSERT语句之一很可能已经警告您有关问题的原因.如果不是,则可以提供有关崩溃的更精确的详细信息,并且很可能在此论坛上获得帮助.

如果您想提供更多详细信息,请使用问题下方的改进问题"按钮,请勿将其粘贴为解决方案.

不想熟悉调试器? -如果您想在这个行业中生存,就必须这样做.
In your question you give too little detail for a good diagnosis.

As a first step I would recommend that you build your project in Debug configuration and start it in the debugger. Then reproduce the crash and probably you will see in the debugger what is happening. Most likely one of the many ASSERT statements in MFC will already alert you about the cause of the problem. If not, you could then give much more precise details about the crash and most likely get help here on this forum.

If you want to put on more details, please use the "improve question" button below your question and DO NOT paste it as a solution.

Don''t want to get familiar with the debugger? -- You will have to, if you want to survive in this industry.


过去,我的任务是将一些大型应用程序从VC6迁移到2008/2010. br/>
我发现更容易生成新的新项目并将代码迁移到它们.我花了一周的时间试图了解为什么这些项目在简单升级后就崩溃了,所以我开始这样做.

该过程完成后,尽管我怀疑是清单系统上可能遗留了一些旧的链接,但我无法确定升级为何导致崩溃的应用程序而迁移的应用程序没有崩溃的原因.
我过去曾给出过这样的建议,并被告知这是一项繁重的工作,而询问的人只是不想这样做.

我很好.

让我们知道如何为您解决问题.
I''ve been tasked with migrating a few big applications from VC6 to 2008/2010 in the past.

I found it easier to generate fresh new projects and to migrate the code to them. I started doing this after wasting a week trying to understand why these projects crashed after simply upgrading them.

After the process was finished, I was unable to pin down why the upgrade produced crashing applications and the migrated apps didn''t, though my suspicion falls on the manifest system and perhaps some old linkages left behind.

I''ve given this advice in the past and have been told it''s too much work and the person asking just didn''t want to do this.

I''m fine with that.

Let us know how this works out for you.


这篇关于从VC ++ 6迁移到VS2010后,MFC应用程序崩溃.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆