Print Page | Close Window

CXTPCalendarEvents::RemoveAll making my app crash

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=10124
Printed Date: 13 May 2024 at 4:01pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPCalendarEvents::RemoveAll making my app crash
Posted By: mass
Subject: CXTPCalendarEvents::RemoveAll making my app crash
Date Posted: 07 April 2008 at 7:13am
CXTPCalendarEventsPtr cEvents = GetDataProvider()->RetrieveDayEvents(COleDateTime::GetCurrentTime());
for (int i = 0; i < cEvents->GetCount(); i++)
{
     CXTPCalendarEvent *p = cEvents->GetAt(i);
     //here I copy the usefull data for me (subject, end and start time in my class with .GetSubject .GetStartTime .GetEndTime
}
cEvents->RemoveAll();

the RemoveAll member produces a unhandled exeption and makes the program crash... If i comment the line the program crashes when the program finishes (when CXTPCalendarEvents destructor is invoked).. Is there any way to solve this?
thx



Replies:
Posted By: mass
Date Posted: 08 April 2008 at 12:50pm
CXTPCalendarEvent *p = cEvents->GetAt(i, TRUE);
this made my app work properly... I still dont know what InternadAddRef does but it works.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net