Normally I just type the code say "CoInitialize" and then put the cursor in
the middle of the text and press F1 to get help, it is usually a nice fast
way to find out if the function is delphi or win32.

Chris

The CoInitialize function initializes the Component Object Model(COM)
library. You must initialize the library before you can call its functions.
Applications must call CoInitialize before they make any other COM library
calls with two exceptions: the CoGetMalloc function, and memory allocation
calls.

HRESULT CoInitialize(

    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, CoInitialize returns E_INVALIDARG.

Return Values

S_OK

Indicates the library was initialized successfully.

S_FALSE

Indicates that the library is already initialized or that it could not
release default allocator.

E_OUTOFMEMORY

Indicates that it was unable to initialize because the system is out of
memory.

E_INVALIDARG

Indicates the argument is invalid.

E_UNEXPECTED

Indicates an unexpected error occurred.

Comments

You need to call this before you call any of the OLE library functions
unless you call the OleInitialize function, which calls CoInitialize
internally.
Typically, CoInitialize 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 CoInitialize,
including those that return S_FALSE, must be balanced by a corresponding
call to the CoUninitialize function.

See Also

CoInitialize, OleInitialize

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Steven Wild
Sent: Sunday, August 01, 1999 12:20 PM
To: Multiple recipients of list delphi
Subject: [DUG]: Colnitialize


I have imported an activeX component and created a simple test
application to see that it works.  It does.

However, when I then take that same component and add it to an
existing application I get the following error.
    "Exception EOleSysError ..............
     Colnitialize has not been called."

I can not find any reference to "Colnitialize", nor do I understand
why it works in one context but not the other.

Any help would really be appreciated.

Steven
Steven Wild
Director
Wild Software Ltd
P O Box 33-216
Christchurch, NZ
Ph & Fax  64 3 377-0495
    _______________________

    Chreos Business Systems
    _______________________
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to