CXTPCalendarRemindersManager::Dismiss() |
Post Reply |
Author | |
mitcheljh
Groupie Joined: 20 July 2008 Location: United States Status: Offline Points: 35 |
Post Options
Thanks(0)
Posted: 28 December 2009 at 7:48pm |
After having problems dismissing reminders, I took a look at
CXTPCalendarRemindersManager::Dismiss(CXTPCalendarReminder* pReminder), and from all indications, the function seems to be operating on a reminder pointer after it has been deleted. In the function, the reminder is first removed from the active reminders array. Stepping through the RemoveAt() function shows the destructor of the removed reminder is being explicitly called when its removed from the array. The debugger also shows that reminder as being deallocated. Afterwards, the pointer to the deleted reminder is passed to the _Dismiss() operation, which fails for me, because that object is already deleted. Should I be calling this Dismiss() operation with a cloned reminder? If so, I can't seem to find a clone operation for this object. Thanks for any help, Mitchel |
|
mitcheljh
Groupie Joined: 20 July 2008 Location: United States Status: Offline Points: 35 |
Post Options
Thanks(0)
|
I found the solution.
I should have investigated a little more before posting, sorry. Rather than remove the post, I think I'll leave it for anyone else with the same issue. I was using... CXTPCalendarReminders::GetAt(int idx) to retrieve the pointer to the reminder I wanted to dismiss. By using this instead... CXTPCalendarReminders::GetAt(int idx, BOOL withAddRef) and passing TRUE, to add an internal reference to the returned reminder, I was able to call dismiss on that reminder without incident. (I also needed to delete the reminder pointer manually, since I increased the reference for it). I should note also, I'm using my own custom dialog for reminders, which is why I'm needing to call these operations in the first place. Anyway, all is well. Thanks, Mitchel |
|
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 |