Microsoft has an excellent demo
[http://support.microsoft.com/default.aspx/kb/199515] for switching views in
MFC SDI application. However I discovered it breaks with a tiny change and
its quite nasty.
All I want is the tree to have editable fields so I changed the tree style
accordingly in MyTreeView.cpp line 148.
::SetWindowLong(m_pTreeCtrl->m_hWnd, GWL_STYLE, style | TVS_EDITLABELS); //
make the tree editable
But just this change breaks the tree view. Run the demo now, click in the
tree to bring up the edit box and now just click inside the edit box, it
ASSERTS and its a hard to go anywhere with this call stack.
I am actually working on a different project when I come across the same
problem. I eventually was able to trace it to the original demo that I am
using as guide.
Why does this unexpected crash happens at first place? How to resolve it?
Can we get anything useful from this callstack?
Environment: VC++ 6 / XP Pro