Print Page | Close Window

How to retrieve recurring reminders from the past?

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=16632
Printed Date: 27 September 2024 at 10:17am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to retrieve recurring reminders from the past?
Posted By: dennisV
Subject: How to retrieve recurring reminders from the past?
Date 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)



Replies:
Posted By: dennisV
Date 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)


Posted By: dennisV
Date 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)


Posted By: Marco1
Date 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.



Posted By: dennisV
Date 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)


Posted By: dennisV
Date 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)



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