Поделиться через


ITask::GetRecurrencePattern (Windows CE 5.0)

Send Feedback

Returns the IRecurrencePattern object that represents the recurrence attributes of a task. If there are no existing recurrence attributes an empty IRecurrencePattern object is returned.

HRESULT GetRecurrence(IRecurrencePattern* pRec);

Parameters

  • pRec
    [out] Pointer to the recurrence pattern.

Return Values

S_OK indicates success. If an error occurs, the appropriate HRESULT is returned.

Example

The following code sets the recurrence pattern attributes for a new Task.

void CreateRecurringTask (IApplication *pApp)
{
  ITask *pTask;
  IRecurrencePattern *pRec;
  SYSTEMTIME st;
  DATE date;

  // Create task
  polApp->CreateItem (olTaskItem, (IDispatch**)&pTask);
  pTask->put_Subject (TEXT ("Recurring Task"));

  // Convert Monday, 4/5/99 to a DATE
  memset (&st, 0, sizeof (SYSTEMTIME));
  st.wMonth = 4;
  st.wDay   = 5;
  st.wYear  = 1999;
  polApp->SystemTimetoVariantTime (&st, &date);

  // Set the start and due date and save the task
  polTask->put_StartDate (date);
  polTask->put_DueDate (date);
  polTask->put_Importance (olImportanceHigh);

  // Set the recurrence pattern
  pTask->GetRecurrencePattern (&pRec);
  pRec->put_RecurrenceType (olRecursWeekly);
  pRec->put_DayOfWeekMask (olTuesday);
  pRec->put_NoEndDate (TRUE);
  polTask->Save ();

  // Release objects
  pTask->Release ();
  pRec->Release ();
}

Requirements

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

See Also

ITask | ITask Properties

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.