Click here to Skip to main content
12,698,476 members (24,199 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ MFC
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,
Posted 28-Nov-12 2:25am
Argonia 28-Nov-12 7:50am
You give too little information- what is the message you get when the application crashes, where exactly it does, did you debug it, maybe uninitialized variable etc...
Stefan_Lang 28-Nov-12 9:04am
As Argonia said, you've given us nothing to work on. That's like telling the mechanic at the garage that your car "sometimes inexplicably breaks down", but then driving away without giving him a chance to inspect it.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

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

editbin /NXCOMPAT:NO Your.exe
JackDingler 28-Nov-12 16:53pm
Good to know.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 28 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100