Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - [solved] DatePickerDemo. Notification doesn't work
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[solved] DatePickerDemo. Notification doesn't work

 Post Reply Post Reply
Author
Message
jmarcosf View Drop Down
Groupie
Groupie


Joined: 22 June 2006
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote jmarcosf Quote  Post ReplyReply Direct Link To This Post Topic: [solved] DatePickerDemo. Notification doesn't work
    Posted: 03 September 2016 at 8:29am
Why in the sample DatePickerDemo Dialog does not receive XTP_NC_DATEPICKER_BUTTON_CLICK messages when coming from Combo CDatePickerCombo class?
Is it a bug?

Thanks!
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 03 September 2016 at 10:12am
Hello jmarcosf,

Thank you for bringing this to our attention. There is really error in file 
Samples\Calendar\DatePickerDemo\DatePickerDemoDlg.cpp line ~196
   ON_NOTIFY(XTP_NC_DATEPICKER_BUTTON_CLICK, 1000, OnButtonPressed)

File Resource.h  has  two the same IDs 1000
#define IDC_CUSTOM1                     1000
#define IDC_DATEPICKER                  1000
So IDC_CUSTOM1 hides IDC_DATEPICKER  and  CDatePickerDemoDlg::OnButtonPressed  doesn't get XTP_NC_DATEPICKER_BUTTON_CLICK notification.
Solution is removing IDC_CUSTOM1 from Resource.h and change ON_NOTIFY() declaration to

   ON_NOTIFY(XTP_NC_DATEPICKER_BUTTON_CLICK, IDC_DATEPICKER, OnButtonPressed)

I have fixed this in sample application.

Regards,
 Oleksandr Lebed
Back to Top
jmarcosf View Drop Down
Groupie
Groupie


Joined: 22 June 2006
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote jmarcosf Quote  Post ReplyReply Direct Link To This Post Posted: 03 September 2016 at 3:17pm
Making that modifications doesn't really solve the problem.
It still continues without printing any TRACE as the blue buttons from the main DatePickerControl does.
Besides, IDC_DATEPICKER is the resource id of this main DatePickerControl but, on the fly generated controls when yo click popup controls do not have this ID. I think that is the real problem. According to the source, popup controls are always created with resource id 0.

By adding the next line, the messages from first popup control is showed but not the ones coming from the combo box.
ON_NOTIFY(XTP_NC_DATEPICKER_BUTTON_CLICK, 0, OnButtonPressed)
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 04 September 2016 at 2:13am
Sorry, I forgot that you ask about CDatePickerCombo class Ermm
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.