BUG (?): DragCopy event ID |
Post Reply |
Author | |
gniemcew
Newbie Joined: 22 June 2007 Status: Offline Points: 3 |
Post Options
Thanks(0)
Posted: 23 June 2007 at 8:37am |
Hi,
Here is an interesting one: when handling drag and drop copy (Ctrl + drag) XTP_NC_CALENDAR_BEFORE_EVENT_EDIT_OPERATION::xtpCalendarEO_DragCopy notification, XTP_EVENT_DRAG_OPERATION_PARAMS member pDraggingEventNew contains the same event ID as the original pDraggingEvent. Effectively, there is no way to know what ID the newly created event will contain once the drag operation has been completed. Anyone else run into this? Any ideas how to solve this one? Thanks... Gary |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Hi,
The Calendar control uses AddEvent method of data provider. You can catch calendar notification XTP_NC_CALENDAREVENTWASADDED. Also to mark that event is coming from dragCopy operation, you can use event custom properties. I mean inside XTP_NC_CALENDAR_BEFORE_EVENT_EDIT_OPERATION notification handler set a custom property for new event, like: COleVariant varOrigID = (long)pDraggingEventNew->GetEventID(); pDraggingEventNew->GetCustomProperties()->SetProperty("DragCopyEventIDorig", varOrigID); Inside XTP_NC_CALENDAREVENTWASADDED notification handler: CXTPCalendarEvent* pEvent = (CXTPCalendarEvent*)lParam; COleVariant varOrigID; if (pEvent->->GetCustomProperties()->GetProperty("DragCopyEventIDorig", varOrigID)) { // this event added by DragCopy operation. DWORD dwNewID = pEvent->GetEventID(); // as example, remove this custom property and update event pEvent->GetCustomProperties()->RemoveProperty("DragCopyEventIDorig"); VERIFY( pEvent->GetDataProvider()->ChangeEvent(pEvent) ); } -- WBR, Serge |
|
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 |