Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Establishing a POOM Session

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

Before you can create and manipulate PIM items, you must first create an instance of the Outlook Mobile application object, and then use it to establish a POOM session, which opens a connection to the PIM database.

  1. Declare and initialize a pointer to the IPOutlookApp interface object:

    IPOutlookApp * g_polApp = NULL;
    
  2. Initialize COM:

    CoInitializeEx( NULL, 0);
    
  3. Create an Application class COM server object:

    CoCreateInstance(CLSID_Application, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (void **)&g_pUnknown);
    
  4. Get a reference to the Outlook Mobile application interface object:

    g_pUnknown->QueryInterface(IID_IPOutlookApp, (void**)&g_polApp);
    
  5. Logon to the Outlook Mobile COM server:

    g_polApp->Logon(NULL);
    

The following code example demonstrates how to create the Outlook Mobile application object and then use it to establish a POOM session.

Aa912815.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.
BOOL InitPoom(void)
{
    IPOutlookApp * g_polApp   = NULL;
    IUnknown     * g_pUnknown = NULL;
    BOOL             bSuccess = FALSE;

    hr = CoInitializeEx(NULL, 0);
    hr = CoCreateInstance(CLSID_Application, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (void **)&g_pUnknown);
    hr = g_pUnknown->QueryInterface(IID_IPOutlookApp, (void**)&g_polApp);

    hr = g_polApp->Logon(NULL);

    bSuccess = TRUE;
    return bSuccess;
}

To make the 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.

  • Include Header File: PimStore.h
  • Linker Dependency: PimStore.lib

Community Additions

Show:
© 2015 Microsoft