Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Comments
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.

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
 
Share this answer
 
Comments
JackDingler 28-Nov-12 16:53pm    
Good to know.
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.
 
Share this answer
 
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.
 
Share this answer
 

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