Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

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

Note   In the code example, SysFreeStringis called on the IPOutlookAppobject. Because SysFreeStringis 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 SysFreeStringdirectly.

Copy Code
HRESULT hr;

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.
polApp->get_Version(&pwszVersion);

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

polApp->SysFreeString(pwszVersion);

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

return TRUE;

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

Copy Code
Dim polApp as PocketOutlook.Application

Set polApp = CreateObject("PocketOutlook.Application")

polApp.Logon()

MsgBox polApp.Version()

See Also