Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

The GetRecurrencePatternmethod gets the IRecurrencePatternobject that represents the recurrence attributes of a TASK. If there are no existing recurrence attributes, an empty IRecurrencePatternobject is returned.

Syntax

HRESULT GetRecurrencePattern(
   IRecurrencePattern ** 
ppRec
);

Parameters

ppRec

[out] Reference to the IRecurrencePatternobject.

Return Value

This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:

S_OK

The method completed successfully.

Example

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

Copy Code
void CreateRecurringTask(IApplication * pApp)
{
	ITask			* pTask; // A Task object.
	IRecurrencePattern * pRec;  // A recurrence pattern object.
	SYSTEMTIME		 st;  // A structure representing a
date and time.
	DATE				 date;  // The date/time expressed as a
Variant time (as a DOUBLE).

	// Create a Task item.
	pApp->CreateItem(olTaskItem, (IDispatch**)&pTask);

	memset(&st, 0, sizeof(SYSTEMTIME)); 	// Set all
bytes in the SYSTEMTIME structure to zero.

	// Convert the date Saturday, 05/10/07 to a Variant DATE
object.
	st.wMonth = 5;
	st.wDay   = 10;
	st.wYear  = 2007;

	pApp->SystemTimetoVariantTime(&st, &date);   // date
now contains the variant version of the date/time.

	// Set the start date, due date, the Importance to High, and
the subject.
	pTask->put_StartDate(date);
	pTask->put_DueDate(date + 14); 		 // Two weeks
after the start date.
	pTask->put_Importance(olImportanceHigh);
	pTask->put_Subject(TEXT("This is an example of a Recurring
Task"));

	// Set the recurrence pattern.
	pTask->GetRecurrencePattern(&pRec);

	pRec->put_RecurrenceType(olRecursWeekly);
	pRec->put_DayOfWeekMask(olTuesday);
	pRec->put_NoEndDate(TRUE);

	pTask->Save(); 				// Save the Task.

	pTask->Release(); 			 // Release resources.
	pRec->Release();
}

Requirements

Header pimstore.h
Library Pimstore.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also