Export (0) Print
Expand All

OlDaysOfWeek

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

The OlDaysOfWeek enumeration identifies the days used in an IRecurrencePattern object.


enum OlDaysOfWeek {
  olSunday    = 1,
  olMonday    = 2,
  olTuesday   = 4,
  olWednesday = 8,
  olThursday  = 16,
  olFriday    = 32,
  olSaturday  = 64
};

olSunday

A weekly recurrence every Sunday.

olMonday

A weekly recurrence every Monday.

olTuesday

A weekly recurrence every Tuesday.

olWednesday

A weekly recurrence every Wednesday.

olThursday

A weekly recurrence every Thursday.

olFriday

A weekly recurrence every Friday.

olSaturday

A weekly recurrence every Saturday.

The values in this enumeration are in a sequence that doubles between values. This allows you to specify combinations of multiple values by combining individual values with the bitwise OR. For example, the value 6 is interpreted to mean both 2 and 4 together.

The following code example demonstrates how to set a weekly recurrence occurring every Monday and Tuesday. pRecurrence is a pointer to an item of type IRecurrencePattern.

Aa908573.note(en-us,MSDN.10).gifNote:
To make the following code example easier to read, security checking and error handling are not included. This code example should not be used in a release configuration unless it has been modified to include them.
IAppointment *pAppt;             // The Appointment item.
IRecurrencePattern *pRecurrence; // The Recurrence Pattern.
SYSTEMTIME st;                   // A System Time Object.
DATE date;                       // A DATE object.

// Create an Appointment item from the POOM Application object.
hr = polApp->CreateItem(olAppointmentItem, (IDispatch**)&pAppt);

// Create a DATE object representing the date Thursday, May 10th, 2007, 8:00 PM.
memset(&st, 0, sizeof(SYSTEMTIME));

st.wMonth = 5;
st.wDay   = 10;
st.wYear  = 2007;
st.wHour  = 20;

hr = polApp->SystemTimeToVariantTime(&st, &date);

// Set the appointment's subject and start date.
hr = pAppt->put_Subject(TEXT("Test Appointment"));
hr = pAppt->put_Start(date);

// Set the RecurrencePattern on the appointment.
hr = pAppt->GetRecurrencePattern(&pRecurrence);
hr = pRecurrence->put_RecurrenceType(olRecursWeekly);
hr = pRecurrence->put_DayOfWeekMask(olMonday | olTuesday);
hr = pRecurrence->put_NoEndDate(VARIANT_TRUE);

// Save the Appointment item.
pAppt->Save();

Headerpimstore.h
LibraryPimstore.lib
Windows Embedded CEWindows CE 3.0 and later
Windows MobilePocket PC 2000 and later, Smartphone 2002 and later

Community Additions

ADD
Show:
© 2014 Microsoft