Step 1: Initialize the COM Library

[This is preliminary documentation and subject to change.]

Before you can start using Active Accessibility's features, you must initialize the Component Object Model (COM) library by calling the CoInitialize OLE function. Babble calls this function before initializing the text to speech engine in its InitTTS application-defined function. InitTTS does several things specific to the speech engine after initializing COM, but the following code fragment illustrates how it calls CoInitialize.

// Attempt to initialize OLE.
if (FAILED(CoInitialize(NULL))) 
    return FALSE;
 

CoInitialize accepts only one parameter, pvReserved, that must always be set to NULL. The function returns a value that indicates success or failure—Babble uses the FAILED macro to test for a failure condition. If the call fails, then COM could not be initialized and application cannot successfully run. FAILED is a macro found in the COM interface.