使用visual studio 2010执行MDI应用程序失败。 [英] Execution failure of MDI application using visual studio 2010.

查看:144
本文介绍了使用visual studio 2010执行MDI应用程序失败。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Microsoft的Visual Studio 2010成功编译,链接和执行MDI应用程序.Visual Studio(专业版)在Windows XP下运行。但是,在Microsoft自动更新afxwin.h之后,应用程序构建时没有错误,但在运行时失败。显示Windows诊断消息(即文件描述遇到错误。很抱歉给您带来不便)。



我很高兴知道其他人是否遇到过这个问题。在一个调试会话中,我发现故障点就在这一行:



CRuntimeClass * pClassThis = GetRuntimeClass();


函数中包含
,CObject :: IsKindOf(const RuntimeClass * pClass);



函数IsKindOf包含在Windows组件objcore中。 cpp,并在执行MDI应用程序的InitInstance函数时调用。



我无法确定恢复以前版本的afxwin.h是否能解决问题,如我无法定期备份Visual Studio支持文件。



我尝试过:



我尝试从备份库执行旧版本的应用程序。他们执行没有失败。但是,如果我使用构建它们的源代码重建这些旧版本的应用程序,则会遇到相同的错误。

I have been successfully compiling, linking, and executing an MDI application using Microsoft's Visual Studio 2010. Visual Studio (pro edition) is running under Windows XP. However, following an automatic update of afxwin.h by Microsoft, the application builds without error, but fails at runtime. A Windows diagnostic message is displayed (i.e., "File Description has encountered an error. Sorry for the inconvenience").

I would appreciate knowing whether others have experienced this problem. In a debugging session I discovered the point of failure was the line:

CRuntimeClass* pClassThis = GetRuntimeClass() ;

contained within the function, CObject::IsKindOf(const RuntimeClass* pClass) ;

The function "IsKindOf" is contained within the Windows component, objcore.cpp, and is called during execution of the MDI application's InitInstance function.

I am unable to determine whether restoring the previous version of afxwin.h would solve the problem, as I failed to regularly backup Visual Studio support files.

What I have tried:

I have tried executing older versions of the application from backup libraries. They execute without failure. However, if I rebuild these older versions of the application using their source code with which they were built, the same error is encountered.

推荐答案

尝试全部重建在清理所有构建文件之后。有时MS改变了一些文件,因此数据不一致。作为紧急修复,您可以更改代码以避免崩溃。



但核心问题是Windows XP:它已经过时了。如果问题仍然存在,则需要一些旧版本的Visual Studio 2010.您可以在卸载后找到一些安装并重新安装。 (有时最好使用干净的PC)。



如果可能,请考虑更新到Windows 7.
Try a "Rebuild All" after a "Clean Up all Build Files". Sometimes MS had changed some files so data gets inconsistent. As an emergency fix you could change the code to avoid the crash.

But the core problem is Windows XP: it is outdated. If the problem stays you need some older version of Visual Studio 2010. You may find some installation and reinstall it, after deinstall. (Sometimes it is better to use a clean PC).

Consider updating to Windows 7 if it is possible.


你在\atlmfc\src\mfc目录中有MFC源代码 - 所以调试函数并找到它爆炸的地方



GetRunTimeClass 是一个虚拟的tho,所以你的impl中可能存在直接或间接损坏的东西
you have the MFC source code in \atlmfc\src\mfc directory - so debug into the function and find where it's exploding

GetRunTimeClass is a virtual tho, so there's probably something broken in your impl, directly or indirectly


谢谢你们(KarsenK和barneyman)花时间提供建议。我认为最好的是,根据我的尝试失败(缺少kludging代码)解决问题,从我的分发磁盘重新安装Visual Studio 2010。如果它继续失败,我将做我知道我最终必须做的事情,即升级到Windows 7和Visual Studio 2015(或2017,尽管我害怕处理通常会感染新的和不稳定版软件的bug )。



祝你好运,

Darryl Major
Thank you both (KarsenK and barneyman) for taking the time to offer suggestions. I think it best, in light of my failed attempts (short of "kludging" the code) to fix the problem, to reinstall Visual Studio 2010 from my distribution disk. If it continues to fail, I'll do what I knew I would eventually have to do, namely, to upgrade to Windows 7 and Visual Studio 2015 (or 2017, though I dread dealing with bugs which commonly infest new and unstable versions of software).

Best regards,
Darryl Major


这篇关于使用visual studio 2010执行MDI应用程序失败。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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