次の方法で共有


IPOutlookApp (Windows Embedded CE 6.0)

1/6/2010

The IPOutlookApp interface represents the Outlook Mobile application object. This object serves the following purposes:

  • As the root object, it provides access to all of the other objects in the POOM hierarchy.
  • It provides direct access to newly created items, without having to traverse the object hierarchy.
  • It provides direct access to existing items.

An application creates this interface by calling CoCreateInstance, using the CLSID_Application globally unique identifier (GUID), and receives a reference to an application object. The application object is the only POOM object retrieved with CoCreateInstance.

Methods in Vtable Order

IPOutlookApp methods Description

IPOutlookApp::Logon

Logs the user on to a POOM Session.

IPOutlookApp::Logoff

Logs the user off of a POOM Session.

IPOutlookApp::get_Version

Gets a three-part string describing the version of Outlook Mobile (or of Pocket Outlook) that is in use.

IPOutlookApp::GetDefaultFolder

Gets an IFolder object for one of the five folders provided by Outlook Mobile.

IPOutlookApp::CreateItem

Creates and gets a POOM item.

IPOutlookApp::GetItemFromOid

Retrieves the item specified by a Windows Embedded CE object identifier (OID).

IPOutlookApp::get_HomeCity

Gets an ICity object that represents the user's home city.

IPOutlookApp::put_HomeCity

Sets an ICity object that represents the user's home city.

IPOutlookApp::get_VisitingCity

Gets an ICity object that represents the city in which the user is currently visiting.

IPOutlookApp::put_VisitingCity

Sets an ICity object that represents the city in which the user is currently visiting.

IPOutlookApp::get_CurrentCityIndex

Gets either IPOutlookApp::get_HomeCity or IPOutlookApp::get_VisitingCity, depending on whether the current city in use by World Clock is the home or visiting city.

IPOutlookApp::put_CurrentCityIndex

Sets either IPOutlookApp::get_HomeCity or IPOutlookApp::get_VisitingCity, depending on whether the current city in use by World Clock is the home or visiting city.

IPOutlookApp::ReceiveFromInfrared

Initiates reception of an item over an infrared link.

IPOutlookApp::get_OutlookCompatible

Returns TRUE if the mobile device is partnered with a desktop computer running Outlook and returns FALSE if the desktop computer is running Schedule+.

IPOutlookApp::GetTimeZoneFromIndex

Uses a time zone index to return an ITimeZone object for the corresponding time zone.

IPOutlookApp::GetTimeZoneInformationFromIndex

Uses a time zone index to get the TIME_ZONE_INFORMATION structure (declared in winbase.h) for the corresponding time zone.

IPOutlookApp::get_Application

Gets the main Outlook Mobile application object.

IPOutlookApp::SysFreeString

Frees a string that was previously allocated.

IPOutlookApp::VariantTimeToSystemTime

Converts the Variant representation of time to it's system time equivalent.

IPOutlookApp::SystemTimeToVariantTime

Converts a system time object to it's Variant equivalent.

Example

The following example shows how to create an Outlook Mobile application object, log on, and display the Outlook Mobile version.

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.

#define INITGUID
#include <windows.h>
#include <pimstore.h>

HRESULT        hr;
IPOutlookApp * polApp;

// Initialize COM.
CoInitializeEx(NULL, 0);

// Get the Outlook Mobile application object.
hr = CoCreateInstance(CLSID_Application, NULL, CLSCTX_INPROC_SERVER, IID_IPOutlookApp, (LPVOID*)&polApp);

// Log on to POOM.
hr = polApp->Logon(NULL);

// Get the Outlook Mobile version, and display it in a message box.
BSTR pwszVersion = NULL;
polApp->getVersion(&pwszVersion);
MessageBox(NULL, pwszVersion, TEXT("Outlook Mobile Version"), MB_SETFOREGROUND | MB_OK);

// Free the version string.
SysFreeString(pwszVersion);
// Note: For Microsoft Palm-size PC 1.0, use the Application method:
// polApp->SysFreeString(pwszVersion).
// Log off and release the POOM application object.
polApp->Logoff();
polApp->Release();

Requirements

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

See Also

Reference

Pocket Outlook Object Model Interfaces

Other Resources

Pocket Outlook Object Model Enumerations