3.2.4.4.6 ComputeEvents (Opnum 12)

The ComputeEvents method computes the calendar events in a specified time interval. It returns the list of all calendar events from the system in pbstrEvents with a start time greater than or equal to the one specified in szStartTime and with an end time less than or equal to the one specified in szEndTime. If the method is called with fMergeEvents set to TRUE, conflicting events are merged and returned in pbstrConflicts.

 [id(6), helpstring("method ComputeEvents")] HRESULT ComputeEvents(
   [in] BSTR szStartTime,
   [in] BSTR szEndTime,
   [in] BOOL fMergeEvents,
   [out] BSTR* pbstrEvents,
   [out] BSTR* pbstrConflicts
 );

szStartTime: A string that specifies the start time to compute calendar events, in time format (section 2.2.1.3).

szEndTime: A string that specifies the end time to compute calendar events, in time format.

fMergeEvents: A Boolean value that specifies whether to merge calendar events. All conflicting events, that is, those whose start time and end time overlap, are returned in pbstrConflicts. If the fMergeEvents value is TRUE, conflicting events are merged into a new event with the start-time DtTmStart element picked from the event with the earliest start time and the end-time DtTmEnd, PolicyName, and CalendarName elements picked from the event with the latest end time.

Value

Meaning

FALSE

0x00000000

The server SHOULD NOT merge calendar events.

TRUE

0x00000001

The server SHOULD merge calendar events.

pbstrEvents: A pointer to a string that returns a list of events that are computed during execution, in the form of an Events element (section 2.2.5.15). For an example, see Events Example (section 4.2.12).

pbstrConflicts: A pointer to a string that returns a list of conflicting events during the specified time interval, in the form of an Events element (section 2.2.5.15). For an example, see Events Example (section 4.2.12).

Return Values: This method returns 0x00000000 for success or a negative HRESULT value (in the following table or in [MS-ERREF] section 2.1.1) if an error occurs.

Return value/code

Description

0x00000000

S_OK

Operation successful.

0x80070057

E_INVALIDARG

One or more arguments are invalid.

Additional IWRMCalendar interface methods are specified in section 3.2.4.4.