![]() |
On clicking DatePicker control return wrong date. |
Post Reply ![]() |
Author | |
prashant ![]() Senior Member ![]() ![]() Joined: 19 February 2007 Location: India Status: Offline Points: 165 |
![]() ![]() ![]() ![]() ![]() Posted: 07 November 2008 at 6:21am |
I have class:
class CmcDatePickerControl : public CXTPDatePickerControl I am trapping message void CmcDatePickerControl::OnLButtonDown(UINT nFlags, CPoint point) Code is as follows: CXTPDatePickerDaysCollection* pDaysCollection = NULL; pDaysCollection = this->GetSelectedDays(); COleDateTime cDate; struct CXTPDatePickerDaysCollection::SELECTED_BLOCK blk; blk = pDaysCollection->GetSelectedBlock(0); cDate.m_dt = (long)blk.nDateBegin; //DatetoStruct(, &ds); int nDay = cDate.GetDay(); int nMonth = cDate.GetMonth(); int nYear = cDate.GetYear(); It's not returning me "Currently selected date" instead it's returning me "Previous selection date". Same code works fine on: void CmcDatePickerControl::OnLButtonDblClk(UINT nFlags, CPoint point) returning correct date. What am I doing wrong here? |
|
![]() |
|
prashant ![]() Senior Member ![]() ![]() Joined: 19 February 2007 Location: India Status: Offline Points: 165 |
![]() ![]() ![]() ![]() ![]() |
Hello Oleg / Codejock support team.
For your convinience I have attached modified source code, please debug to find the problem. In a source code place a breakpoint where you fing following tag: ///Code aded by Prashant ///!<HERE WE ARE GETTING PREVIOUS SELECTION DATE> uploads/20081107_071030_CalendarDemo.zip Thanks in advance. |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Obviously you should call base method first to update selected day.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |