|
OleInitialize
The OleInitialize function initializes the OLE library. You must initialize the library before
you can call OLE functions.
HRESULT OleInitialize(
LPVOID pvReserved
| //Reserved, must be NULL
| );
|
|
Parameter
pvReserved
In 32-bit OLE, this parameter must be NULL. The 32-bit version of OLE does not
support applications replacing OLE's allocator and if the parameter is not
NULL, OleInitialize returns E_INVALIDARG.
Return Values
S_OK
Indicates the library was initialized successfully.
S_FALSE
Indicates OLE library is already initialized; a pointer to the IMalloc implementation was not used.
OLE_E_WRONGCOMPOBJ
Indicates COMPOBJ.DLL is the wrong version for OLE2.DLL.
E_OUTOFMEMORY
Indicates the library was not initialized because the system was out of memory.
E_INVALIDARG
Indicates an argument was invalid.
E_UNEXPECTED
Indicates an unexpected error occurred.
Comments
Applications must call OleInitialize before calling any other function in the OLE library.
Typically, OleInitialize is called only once in the process that uses the OLE library. There can be
multiple calls, but subsequent calls return S_FALSE. To close the library
gracefully, each successful call to OleInitialize, including those that return S_FALSE, must be balanced by a corresponding call to the OleUninitialize function.
See Also
OleUninitialize, CoInitialize
Related LinksSoftware for Delphi and C++ Builder developers Software for Visual Studio .NET developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference (win32.hlp) Win32 Multimedia Programmer's Reference (mmedia.hlp) Microsoft Windows Pen API Programmer's Reference (penapi.hlp) Microsoft Windows Sockets 2 Reference (sock2.hlp) Microsoft Windows Telephony API (TAPI) Programmer's Reference (sock2.hlp) Unix Manual Pages
|