Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - CXTPCalendarRemindersManager::Dismiss()
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPCalendarRemindersManager::Dismiss()

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


Joined: 20 July 2008
Location: United States
Status: Offline
Points: 35
Post Options Post Options   Thanks (0) Thanks(0)   Quote mitcheljh Quote  Post ReplyReply Direct Link To This Post Topic: CXTPCalendarRemindersManager::Dismiss()
    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
Back to Top
mitcheljh View Drop Down
Groupie
Groupie


Joined: 20 July 2008
Location: United States
Status: Offline
Points: 35
Post Options Post Options   Thanks (0) Thanks(0)   Quote mitcheljh Quote  Post ReplyReply Direct Link To This Post Posted: 28 December 2009 at 9:26pm
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
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.125 seconds.