---
name: "CoInitializeEx"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/CoInitializeEx"
---

# CoInitializeEx(3w)

## NAME

**CoInitializeEx** (OLE32.@)

## SYNOPSIS

HRESULT CoInitializeEx\
  (\
   LPVOID *lpReserved*,\
   DWORD  *dwCoInit*\
  )

## DESCRIPTION

Initializes the **COM** libraries.

## PARAMS

*lpReserved* **\[In\]**  Pointer to **IMalloc** interface (obsolete, should be **NULL**).

*dwCoInit* **\[In\]**  One or more flags from the **COINIT** enumeration. See notes.

## RETURNS

**S\_OK** if successful, **S\_FALSE** if this function was called already. **RPC\_E\_CHANGED\_MODE** if a previous call to CoInitializeEx specified another threading model.

## NOTES

The behavior used to set the IMalloc used for memory management is obsolete. The *dwCoInit* parameter must specify one of the following apartment threading models: \
\
  COINIT\_APARTMENTTHREADED - A single-threaded apartment (STA).\
\
  COINIT\_MULTITHREADED - A multi-threaded apartment (MTA).

The parameter may also specify zero or more of the following flags: \
\
  COINIT\_DISABLE\_OLE1DDE - Don't use DDE for OLE1 support.\
\
  COINIT\_SPEED\_OVER\_MEMORY - Trade memory for speed.

## SEE ALSO

CoUninitialize

## IMPLEMENTATION

Declared in **"compobj\_private.h"**.

Implemented in **"dlls/ole32/compobj.c"**.

Debug channel **"ole"**.
