I have a Windows application which I'm working on and have experienced a strange problem when debugging. I'm using WTL, and have a CDateTimePickerCtl on the form to set a date. I'm handling the DTN_DATETIMECHANGE event with the following in my message map:
NOTIFY_HANDLER(CONTROL_ID_DATE, DTN_DATETIMECHANGE, OnDateChanged)
This works fine when the app is running in the debugger with no breakpoints. If I have a break point in the OnDateChanged function, even on the first line, VS hangs if I change the time via the drop down calendar. No problems if I edit the date by typing into the control.
I've even attempted to have OnDateChanged just call PostMessage, with an application specific message to try to get around the issue, but if I have a break point in that message handler I get the same odd issue.
It gets even stranger. Not only does VS hang, but once VS is hung, some other applications will hang as well. IE 10, Chrome, Outlook hang, Notepad does not. This is completely repeatable.
I end up having to kill VS several times via Task Manager.
You can see the ticket I've opened with MS Connect here:
The main question I have is if anyone else has seen this issue and/or if they can reproduce it. I've had another developer here repro on a different machine with the same code, but haven't put together a stripped down version of the code to just repo.
Also note that I'm running VS 2008 on Win7 64 bit.
On earlier versions of Windows I had same issue with combo boxes. Especially when breakpoint set at close time and initiated by another control activation or so. It looks very possible that problem exists also in datetime. For such cases I would recommend use TRACE/ATLTRACE call for debugging purposes.