Expand Minimize

RoInitialize function

Initializes the Windows Runtime on the current thread with the specified concurrency model.

Syntax


HRESULT WINAPI RoInitialize(
  _In_  RO_INIT_TYPE initType
);

Parameters

initType [in]

Type: RO_INIT_TYPE

The concurrency model for the thread. The default is RO_INIT_MULTITHREADED.

Return value

Type: HRESULT

This function can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following values.

Return codeDescription
S_OK

The Windows Runtime was initialized successfully on this thread.

S_FALSE

The Windows Runtime is already initialized on this thread.

RPC_E_CHANGED_MODE

A previous call to RoInitialize specified the concurrency model for this thread as multithread apartment (MTA). This could also indicate that a change from neutral-threaded apartment to single-threaded apartment has occurred.

 

Remarks

Use the RoInitialize function to initialize a thread in the Windows Runtime. All threads that activate and interact with Windows Runtime objects must be initialized prior to calling into the Windows Runtime.

Call the RoUninitialize function to close the Windows Runtime on the current thread. Each successful call to RoInitialize, including those that return S_FALSE, must be balanced by a corresponding call to RoUninitialize.

Windows Phone 8: This API is supported.

Windows Phone 8.1: This API is supported.

Requirements

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 [desktop apps | Windows Store apps]

Header

Roapi.h

See also

RO_INIT_TYPE
RoUninitialize
CoInitializeEx

 

 

Community Additions

ADD
Show:
© 2014 Microsoft