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
Microsoft Visual C++ 2005 Redistributable Package and
Microsoft Visual C++ 2008 Redistributable Package on our machine as mentioned in the post
The application developed by VC++ 6.0 but crashed in Windows 7 , 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?