Exception when deleting appointments in weekview |
Post Reply |
Author | |
Alex H.
Senior Member Joined: 12 February 2004 Status: Offline Points: 266 |
Post Options
Thanks(0)
Posted: 29 March 2017 at 9:05am |
It happens in weekview when deleting by keyboard using command (DEL) from various days (ony by one). XTP 17.3 (MFC) with VS2015 |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Hello Alex,
I can't reproduce this. Can you reproduce this in our CalendarDemo sample ? Add GIF of reproducing, screenshot of used options (Options dialog). Regards, Oleksandr Lebed |
|
Alex H.
Senior Member Joined: 12 February 2004 Status: Offline Points: 266 |
Post Options
Thanks(0)
|
Hello Oleksandr,
I can't reproduce it with the Calendar Demo. We use a cutom data provider in our sample. But the problem seems to be on a higher level. Can you give use some information how that can happen? Here is how we add Events: //--------------------------------------------------------------------------------------- void CUICJCalendarView::OnRetrieveDayEvents(XTP_NOTIFY_CODE /*Event*/, WPARAM wParam , LPARAM lParam) //--------------------------------------------------------------------------------------- { XTP_DATE_VALUE oDate = (XTP_DATE_VALUE) wParam; CXTPCalendarEventsPtr* pEvents = (CXTPCalendarEventsPtr*) lParam; // [in/out] A pointer to pointer to events array COleDateTime dtStart = (DATE)oDate; XTRACE(+1, _T("CUICJCalendarView::OnRetrieveDayEvents( für %s )"), (LPCTSTR) dtStart.Format((UINT)IDS_DATEFMT_DDMMYYYYA)); int nDayCount = GetCalendarCtrl().GetActiveView()->GetViewDayCount(); COleDateTime dtCurrentViewStart = GetCalendarCtrl().GetActiveView()->GetViewDayDate(0); XTRACE(0, _T(" nDayCount = %d and first date (%s) "), nDayCount, (LPCTSTR) dtCurrentViewStart.Format((UINT)IDS_DATEFMT_DDMMYYYYA)); if(*pEvents == NULL) { *pEvents = new CXTPCalendarEvents(); (*pEvents)->InternalAddRef(); } else { (*pEvents)->RemoveAll(); (*pEvents)->InternalAddRef(); ASSERT((*pEvents)->GetCount() == 0); } CWaitCursor oWait; // fill events to my own cache (not the calendar cache) if(dtStart == dtCurrentViewStart && nDayCount > 1) AssignEventsToTmpCache(dtCurrentViewStart, nDayCount); CXTPCalendarEvents* pEventsOfDayFromCache = NULL; int nDBIDate = CMfxDateTime(dtStart).GetDBIDate(); if(m_oMapTmpEvents.Lookup(nDBIDate, pEventsOfDayFromCache)) { XTRACE(0, _T("OnRetrieveDayEvents Count = %d"), pEventsOfDayFromCache->GetCount()); // get value from my cache (*pEvents)->Append(pEventsOfDayFromCache); (*pEvents)->CloneEvents(); XTRACE(0, _T("OnRetrieveDayEvents Count = %d"), (*pEvents)->GetCount()); } else { // get the events by query AssignEvents((*pEvents), dtStart); } (*pEvents)->InternalRelease(); XTRACE(-1, _T("<<CUICJCalendarView::OnRetrieveDayEvents")); } |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
As I can see from your callstack that CXTPCalendarViewGroup::m_pViewDay was initialized with wrong value 0xdddddddd.
It is initialized only in constructor
So you can set breakpoint here with condition "pViewDay == 0xdddddddd" and see what do such initialization. |
|
Alex H.
Senior Member Joined: 12 February 2004 Status: Offline Points: 266 |
Post Options
Thanks(0)
|
Thank you!
Unfortunately it soes not hit that breakpoint. What if the pointer is deleted after it was assigned (missing AddRef and Release) ? This is the Watch of m_pViewGroup. Is looks valid except m_pResources and m_pViewDay. |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
no, m_pViewGroup poiner also invalid.
may be problem in CXTPCalendarViewEventT::GetViewGroup_() (called from CXTPCalendarViewEvent::IsSelected() ) So check pointer pViewEvent->m_pViewGroup in CXTPCalendarView::OnKeyDown() in line 968
|
|
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 |