IInitializeSpy::PostInitialize method

Performs initialization steps required after calling the CoInitializeEx function.

Syntax


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

Parameters

hrCoInit [in]

The value returned by CoInitializeEx.

dwCoInit [in]

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

dwNewThreadAptRefs [in]

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

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

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

Minimum supported client

Windows XP with SP1 [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

ObjIdl.h

IDL

ObjIdl.idl

IID

IID_IInitializeSpy is defined as 00000034-0000-0000-C000-000000000046

See also

CoInitializeEx
IInitializeSpy

 

 

Community Additions

ADD
Show:
© 2014 Microsoft