Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

COINIT (Enums)
 
.
Summary
A set of values from the COINIT enumeration is passed as the second parameter to CoInitializeEx. This value determines the concurrency model used for incoming calls to objects created by the thread making the call. However, since pinvoke is a dotNET construct you should be aware that dotNET already does a COM initialization and therefore calling a CoInitializeEx function most likely will not do what you expect. This problem occurs when trying to instantiate a COM object from within dotNET where the COM objects threading model is different from dotNETs. Search on Common Language Runtime or CLR and COINIT_APARTMENTTHREADED to find posts on this issue.

C# Definition:

enum COINIT {
    /// <summary>
    /// Initializes the thread for multi-threaded object concurrency.
    /// </summary>
    COINIT_MULTITHREADED = 0x0,
    /// <summary>
    /// Initializes the thread for apartment-threaded object concurrency.
    /// </summary>
    COINIT_APARTMENTTHREADED = 0x2,
    /// <summary>
    /// Disables DDE for Ole1 support.
    /// </summary>
    COINIT_DISABLE_OLE1DDE = 0x4,
    /// <summary>
    /// Trades memory for speed.
    /// </summary>
    COINIT_SPEED_OVER_MEMORY = 0x8
}

VB Definition:

Enum COINIT
    ''' <summary>
    ''' Initializes the thread for multi-threaded object concurrency.
    ''' </summary>
    COINIT_MULTITHREADED = 0
    ''' <summary>
    ''' Initializes the thread for apartment-threaded object concurrency.
    ''' </summary>
    COINIT_APARTMENTTHREADED = 2
    ''' <summary>
    ''' Disables DDE for Ole1 support.
    ''' </summary>
    COINIT_DISABLE_OLE1DDE = 4
    ''' <summary>
    ''' Trades memory for speed.
    ''' </summary>
    COINIT_SPEED_OVER_MEMORY = 8
   TODO
End Enum

Notes:

None.

Documentation
COINIT on MSDN
 

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it!

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions