[][src]Function mcom::init::sta

pub fn sta() -> Result<bool, MethodHResult>

[docs.microsoft.com] Initialize COM for this thread, creating an Apartment-Threaded apartment if necessary.

This is typically used for Win32 UI threads

Returns

  • Ok(true) - The COM library was initialized successfully on this thread.
  • Ok(false) - The COM library was already initialized on this thread.
  • Err(e) if e == RPC_E_CHANGED_MODE - A previous call to CoInitializeEx specified this thread belonged to an MTA Apartment.