IInitializeSpy::PostInitialize method (objidl.h)

Performs initialization steps required after calling the CoInitializeEx function.

Syntax

HRESULT PostInitialize(
  [in] HRESULT hrCoInit,
  [in] DWORD   dwCoInit,
  [in] DWORD   dwNewThreadAptRefs
);

Parameters

[in] hrCoInit

The value returned by CoInitializeEx.

[in] dwCoInit

The apartment type passed to CoInitializeEx, specified as a member of the COINIT enumeration.

[in] dwNewThreadAptRefs

The number of times CoInitializeEx has been called on this thread.

Return value

This method returns the value that it intends the CoInitializeEx call to return to its caller. For more information, see the Remarks section.

Remarks

The return value from PostInitialize is intended to be the returned HRESULT from the call to CoInitializeEx. This is always the case for a single active registration on this thread.

For cases where there are multiple registrations active on this thread, the returned HRESULT is arrived at by chaining of the various PostInitialize methods as follows: The COM determined HRESULT will be passed as the hrCoInit parameter to the first PostInitialize method called. The HRESULT from that PostInitialize call will be passed as the hrCoInit parameter to the next PostInitialize call. This chaining continues leading to the HRESULT from the last PostInitialize call being returned as the HRESULT from the call to CoInitializeEx.

Requirements

Requirement Value
Minimum supported client Windows XP with SP1 [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header objidl.h

See also

CoInitializeEx

IInitializeSpy