ComInitialize
f90VB Modules
f90VBDefs, f90VBAutomation
Summary
Initializes the COM library on the current thread and identifies the concurrency model as single-thread apartment (STA).
Syntax
| integer(HRESULT_KIND) function ComInitialize | () |
Arguments
This function has no arguments.
Comments
Applications must initialize the COM library before they can call other functions from the f90VBAutomation library. The preferred method to initialize the COM library when using f90VBAutomation is by calling OleInitialize, rather than ComInitialize.
ComInitialize can return any of the following values:
| Return Value | Description | |
| S_OK | The COM library was successfully initialized on this thread | |
| E_OUTOFMEMORY | The COM library was not initialized because of lack of memory | |
| E_UNEXPECTED | An unexpected error occurred. | |
| S_FALSE | The COM library is already initialized on this thread | |
| RPC_E_CHANGED_MODE | A previous call to ComInitializeEx specified the concurrency model for this thread as multithread apartment (MTA). | |
Calls to ComInitialize must be paired with calls to ComUninitialize (i.e. your program must issue a call to ComUninitialize for each call to ComInitialize). Calls to ComInitialize and OleInitialize can be nested.
Examples
See examples in Chapter 6 - User Manual.
Related Topics
| For information about: | See: | |
| Initializing the COM Library | ComInitializeEx | |
| Uninitializing the COM library | ComUninitialize | |
| Initializing the OLE Library | OleInitialize | |
| Uninitializing the OLE library | OleUninitialize | |