Compartir a través de


IRecurrencePattern::GetOccurrence (Windows CE 5.0)

Send Feedback

This method gets the specific instance of an Appointment occurring on a specific date. Changes to the Appointment then apply only to it. If no exception to a recurring pattern exists, a change creates a new exception; otherwise it modifies an existing exception.

HRESULT GetOccurrence(DATEdate,IAppointmentItem* polAppt);

Parameters

  • date
    [in] The local date and time of the appointment.
  • polAppt
    [out] Pointer to the appointment retrieved by the method.

Return Values

S_OK indicates success. If an error occurs, the appropriate HRESULT is returned (for example, if there is no occurrence on the specified date).

Example

The following code example changes one instance of a recurring appointment.

void ChangeRecurrence (IAppointment *polAppt)
{
  IPOutlookApp *polApp;
  IRecurrencePattern *pRec;
  IAppointment *pAppt2;
  SYSTEMTIME st;
  DATE date;

  // Convert Monday, 4/5/9 at 10:00 am to a DATE
  memset (&st, 0, sizeof(SYSTEMTIME));
  st.wMonth = 4;
  st.wDay   = 5;
  st.wYear  = 1999;
  polApp->SystemTimeToVariantTime (&st, &date);

  // Get the recurrence pattern
  pAppt->GetRecurrencePattern (&pRec);
  pRec->GetRecurrence (date, &pAppt2);

  // Change start time
  st.wHour = 11;
  pAppt2->get_Application (&polApp);
  polApp->SystemTimeToVariantTime (&st, &date);
  pAppt2->put_Start (date);

  // Save the appointment
  pAppt2->Save ();

  // Release objects
  polApp->Release ();
  pRec->Release ();
  pAppt2->Release ();
}

Requirements

OS Versions: Windows CE 2.0 and later.
Header: Pimstore.h.
Link Library: Pimstore.lib.

See Also

IRecurrencePattern | IRecurrencePattern Properties

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.