[][src]Function com::runtime::init_apartment

pub fn init_apartment(apartment_type: ApartmentType) -> Result<(), HRESULT>

Establish an apartment type for the current thread.

This can only be called once per thread and will return an error if it is called more than once.

In general this should only be called on threads created by the user.

This wraps CoInitializeEx. The user is still responsible for establishing a message pump in the case of an STA