Click here to Skip to main content
15,903,854 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 15-Dec-16 22:34pm
v2

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.
 
Share this answer
 
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
 
Share this answer
 
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
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900