Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - How to retrieve recurring reminders from the past?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to retrieve recurring reminders from the past?

 Post Reply Post Reply
Author
Message
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Topic: How to retrieve recurring reminders from the past?
    Posted: 26 April 2010 at 1:15am
Hello all,

It seems that there's either a bug/shortcoming in CJ's code or I'm not doing something right

Let's say I have an recurring event with a reminder set. And let's say that the ocurrence of this event happens while the program is not running. So, the next time the program runs, this ocurrence is skipped. I'm slowly narrowing it down to the UpdateDataFromDP() function in the reminders manager. It seems that it only looks at ocurrences that are in the future from the current time:


    COleDateTime dtNow = CXTPCalendarUtils::GetCurrentTime();

    //-(1) Update cached data if need
    COleDateTime dtNextUpdateTime = m_dtLastUpdateTime + m_spPeriod2Cache;

    BOOL bUpdated = FALSE;
    if (dtNextUpdateTime <= dtNow || 0 == (DATE)m_dtLastUpdateTime)
    {
        DBG_REMINDERS_TRACE(_T("%s - CXTPCalendarRemindersManager::Update from timer ==>>. \n"),
                            CXTPCalendarUtils::GetCurrentTime().Format());

        bUpdated = UpdateDataFromDP(dtNow, m_spPeriod2Cache);
    }


What would be great, if I could specify what date should be used as the dtNow, so that I could pass in a date when the program was last run to make sure that all events are processed correctly.

Is there a simple way to do this, without overriding the whole remindersmanager/calendar/etc...?

Thanks in advance for your thoughts!
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)
Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2010 at 6:30pm
Narrowing it down a bit further, seems that this code makes the reminders disappear:


            if (ptrOccurrenceEvent && ptrOccurrenceEvent->GetStartTime() <
                pMasterEvent->GetLastModificationTime())
            {
                ptrOccurrenceEvent->SetReminder(FALSE);
            }


not sure why GetLastModificationTime() is there...
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)
Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Posted: 27 April 2010 at 6:17pm
so, it appears to me that I need to SetLastModificationTime() at some point, but when? It's reset inside the AddEvent() function to the current time...
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)
Back to Top
Marco1 View Drop Down
Senior Member
Senior Member


Joined: 16 January 2004
Location: Germany
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote Marco1 Quote  Post ReplyReply Direct Link To This Post Posted: 28 April 2010 at 5:04am
Dennis,
some time ago I played around with the integrated calendar reminder logic but there were too many restrictions for the project to be used out of the box.

So I'm running my own database query (periodically) which returns all events to remind. My code handles the necessary action and notifications then.
Only thing I'm using is the reminder icon of the event display.
Sorry, not that what you wanted to hear, but this way saved me a lot of time in my project.

Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Posted: 28 April 2010 at 7:23am
Thanks Marco!

I have hit quite a few restrictions myself and now I'm just trying to see just how much of the code I have to override to get it to work properly. Unfortunately it's not a straight-forward task, as you start with one class and then have to pull in more and more because of members/functions being private/protected. It's a pain really.

Still, if I manage to get it going, I'll post my findings. Otherwise, I might have to take your route and implement reminders logic myself completely.
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)
Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Posted: 28 April 2010 at 8:48am
and of course the most disappointing thing is that there's no reply from the support at all - not here, not in the ticket area - only silence... :(
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)
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.156 seconds.