Share via


IPOutlookApp

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

  • As the root object, it provides access to all other objects in the Pocket Outlook 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 receiving a reference to an application object. The application object is the only Pocket Outlook object retrieved with CoCreateInstance.

Methods in Vtable Order

IPOutlookApp methods Description
Logon Logs the user on to a Pocket Outlook session.
Logoff Logs the user off of a Pocket Outlook session.
get_Version Gets a three-part string describing the version of the Pocket Outlook Object Model in use.
GetDefaultFolder Gets an IFolder object for one of the five folders provided by Pocket Outlook.
CreateItem Creates and gets a Pocket Outlook item.
GetItemFromOid Retrieves the item specified by a Windows CE object identifier (OID).
get_HomeCity Gets an ICity object that represents the user's home city.
put_HomeCity Sets an ICity object that represents the user's home city.
get_VisitingCity Gets an ICity object that represents the city in which the user is currently visiting.
put_VisitingCity Sets an ICity object that represents the city in which the user is currently visiting.
get_CurrentCityIndex Gets either HomeCity or VisitingCity, depending on whether the current city in use by World Clock is the home or visiting city.
put_CurrentCityIndex Sets either HomeCity or VisitingCity, depending on whether the current city in use by World Clock is the home or visiting city.
ReceiveFromInfrared Initiates reception of an item over an infrared link.
get_OutlookCompatible Returns TRUE if the Windows CE device is partnered with a desktop computer running Outlook and returns FALSE if the desktop computer is running Schedule+.
GetTimeZoneFromIndex Uses a time zone index to return the Pocket Outlook ITimeZone object for the corresponding time zone.
GetTimeZoneInformationFromIndex Uses a time zone index to get the TIME_ZONE_INFORMATION structure (declared in Winbase.h) for the corresponding time zone.
get_Application Gets the main Pocket Outlook Aapplication object.
SysFreeString Frees a string that was previously allocated.
VariantTimeToSystemTime Converts the Variant representation of time to it's system time equivalent.
SystemTimeToVariantTime Converts a system time object to it's Variant equivalent.

Example

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

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

HRESULT hr;
IPOutlookApp * polApp;

// Initialize COM for Pocket Outlook.
if (FAILED(CoInitializeEx(NULL, 0))) return FALSE;

// Get the application object.
hr = CoCreateInstance(CLSID_Application, 
                      NULL, 
                      CLSCTX_INPROC_SERVER,
                      IID_IPOutlookApp, 
                      (LPVOID*)&polApp);
if (FAILED(hr)) return FALSE;

// Log on to Pocket Outlook.
hr = polApp->Logon(NULL);
if (FAILED(hr)) return FALSE;

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

// Free the version string.
SysFreeString(pwszVersion);
// Note: For Palm-size PC version 1.0 use the Application method:
// polApp->SysFreeString(pwszVersion).

// Log off and release the application object.
polApp->Logoff();
polApp->Release();
return TRUE;

Requirements

Smartphone: Windows Mobile 2002 and later
OS Versions: Windows CE 3.0 and later
Header: pimstore.h
Library: pimstore.lib

See Also

Pocket Outlook Object Model API Interfaces

Pocket Outlook Object Model API Enumerations

Last updated on Friday, April 22, 2005

© 2005 Microsoft Corporation. All rights reserved.

Send feedback on this topic to the authors.