次の方法で共有


OlDaysOfWeek (Windows Embedded CE 6.0)

1/6/2010

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

Syntax

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

Elements

  • 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.

Remarks

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.

Code Example

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.

Note

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();

Requirements

Header pimstore.h
Library Pimstore.lib
Windows Embedded CE Windows CE 3.0 and later

See Also

Tasks

Creating a Recurring Appointment

Reference

Pocket Outlook Object Model Interfaces
IRecurrencePattern

Other Resources

Pocket Outlook Object Model Enumerations
Pocket Outlook Object Model Common Tasks