Code Example: Determining the Version

Windows Mobile 6.5
A version of this page is also available for

The following C++ code example demonstrates how to get the IPOutlookApp object, log onto Outlook Mobile, and then determine the version of Outlook Mobile that is running.

Note   In the code example, SysFreeString is called on the IPOutlookApp object. Because SysFreeString is not defined on Microsoft Palm-size PC 1.0, this is necessary for the code to compile for that OS. If you will not be compiling this code on that OS, you can go ahead and call SysFreeString directly.


IPOutlookApp * polApp = NULL;
BSTR      pwszVersion = NULL;
// Initialize COM.
CoInitializeEx(NULL, 0);

// Create an instance of the main application object (IApplication).
hr = CoCreateInstance(CLSID_Application, NULL, CLSCTX_INPROC_SERVER, IID_IPOutlookApp, (LPVOID*)&polApp);
// Log on to Outlook Mobile.
hr = polApp->Logon(NULL);

// Get the version, and display it in a message box.

MessageBox(NULL, pwszVersion, TEXT("POOM Version"), MB_SETFOREGROUND | MB_OK);


// Log off and release the Application object.

return TRUE;

The following Visual Basic code example shows you how to determine the version of Outlook Mobile.

Dim polApp as PocketOutlook.Application

Set polApp = CreateObject("PocketOutlook.Application")


MsgBox polApp.Version()

Community Additions