VC++ Application Crash in Windows-7

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
We have a legacy application that was developed in MFC/VC++ in Visual Studio 6 Compiler. This application works perfectly in Windows XP. But in Windows 7 it crashes.
Actually the Application has a MultiSelect MFC Treeview. While clicking on the nodes of the treeview, the application crashes. Same scenario in WinXP works well

We tried installing both http://www.microsoft.com/downloads/details.aspx?FamilyId=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en
Microsoft Visual C++ 2005 Redistributable Package and http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en
Microsoft Visual C++ 2008 Redistributable Package on our machine as mentioned in the post
http://social.msdn.microsoft.com/forums/en-us/vcgeneral/thread/D1DE93AB-FE55-48D1-8821-6E4C43403D51
http://social.msdn.microsoft.com/forums/en-us/vcgeneral/thread/D1DE93AB-FE55-48D1-8821-6E4C43403D51 , but nothing worked.

We did some analysis and found that in the TVN_SELCHANGED event of the treeview, we were sending a custom message to its parent using the call

AgCFunctionalPortsInfo *address = (AgCFunctionalPortsInfo*)m_tree.GetItemData(item);
GetParent()->SendMessage(AG_PORT_CLICKED, (DWORD)address, 0);

But no where in our code, we were handling the custom message AG_PORT_CLICKED. When we commented the following line, it stopped crashing in Windows 7 also

GetParent()->SendMessage(AG_PORT_CLICKED, (DWORD)address, 0);

Now we would like to know the reason for this behavior. Is there any API change happened in windows 7 in this area that is causing the application to crash when there is no handling of custom message sent to a window?
<br/>

View the full article
 
Back
Top