Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - [Solved] Calendar event not being updated
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[Solved] Calendar event not being updated

 Post Reply Post Reply
Author
Message
jordi View Drop Down
Newbie
Newbie
Avatar

Joined: 04 March 2009
Location: Spain
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote jordi Quote  Post ReplyReply Direct Link To This Post Topic: [Solved] Calendar event not being updated
    Posted: 04 March 2009 at 7:44am
ChangeEvent returns FALSE in bTest (see code below).. I've no idea because I only change the reminder minuts before start. I hope you can help me to solve the problem. Thanks.

Platform: Windows XP (32bit) - SP 3
Product: Xtreme Calendar Pro 2007 Vol 2 (MFC) (11.2.2)
Language: C++/MFC-8.0

XXXXX::XXXXX()
{
m_Sink.Advise(m_wndCalendar.GetConnection(), XTP_NC_CALENDAR_ON_REMINDERS, &CCalendar::OnReminders);
}

void XXXXX::OnReminders(XTP_NOTIFY_CODE Event, WPARAM wParam , LPARAM lParam)
{
CXTPCalendarRemindersManager *calRemindersManager = m_wndCalendar.GetRemindersManager();
CXTPCalendarReminders calRemindersL;
CXTPCalendarReminder *pcalReminder;
CXTPCalendarEventPtr cEvent;

calRemindersManager->GetActiveReminders(calRemindersL);

for (int i = 0; i < calRemindersL.GetCount(); i++)
{
    pcalReminder = calRemindersL.GetAt(i);
    cEvent = pcalReminder->GetEvent();

    //discard old events
    if (cEvent->GetEndTime() < COleDateTime::GetCurrentTime())
    {
      pcalReminder->Dismiss();
      continue;
    }

    if (cEvent->GetReminderMinutesBeforeStart() == 1)
    {
      cEvent->SetReminderMinutesBeforeStart(0);
      BOOL bTest = m_wndCalendar.GetDataProvider()->ChangeEvent(cEvent);
    }
    pcalReminder->Dismiss();
}
}


Events were created with SetReminderMinutsBeforeStart(1).

[Solved]
In all test cases the event I was trying to modify was modifing the recurrence pattern instead of the Ocurrence.
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.141 seconds.