Partager via


Code Example: Determining the Version (Windows Embedded CE 6.0)

1/6/2010

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, the SysFreeString method is called on the IPOutlookApp object. You can also call SysFreeString directly.

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.

Dim polApp as PocketOutlook.Application

Set polApp = CreateObject("PocketOutlook.Application")

polApp.Logon()

MsgBox polApp.Version()

See Also

Other Resources

Pocket Outlook Object Model Samples
Pocket Outlook Object Model Application Development