I am using CDateTimeCtrl.cpp a wrapper class over date time picker control in VC 6.0. While moving my code base to VC 7.1 it gives me following errors in the message map section. How can i fix this.
DateTimeCtrl.cpp(121) : error C2440: 'static_cast' : cannot convert from 'BOOL (__thiscall CDateTimeCtrl::* )(NMDATETIMEFORMATW *,LRESULT *)' to 'BOOL (__thiscall CCmdTarget::* )(NMHDR *,LRESULT *)'
None of the functions with this name in scope match the target type
I encountered this problem also and solved it this way
Posted by Matthew Sin
on 04/06/2004 03:02am
In the message handler, change the parameter from NMDATETIMEFORMATW* back to NMHDR*, add a variable of type NMDATETIMEFORMATW* and assign the value of parameter to the variable by casting it from NMDATETIMEFORMATW* to NMHDR*. Use the variable instead of the parameter in the handler
The calandar font size changes randomly when I use cdatetimectrl. Sometimes the calendar will display very large diagonal font making the calendar very large on the display. Has anyone seen this problem or have a fix?
Can you tell me if it is possible to change the color of the text appearing in the edit? The WM_CTCOLOR seems to not work...It is quite easy to change the background color but for the text it seems impossible!
Is it possible to display the date time control as edit only without spin?
I have changed DTS_APPCANPARSE to true in your example and know i have the problem, that some changes (full replace, character delete or insert) in the edit field are revoked after leaving the field. Maybe this is an knwon bug in my environment (NT 4.0 SP6, VC++ 6.0, SP4). Or is there any additional message which have to be handled?