Skip to main content

make_com

Function make_com 

Source
pub fn make_com<I, T>(value: T) -> ComPtr<I>
where I: ImplementedBy<T>, T: 'static,
Expand description

Moves value to the heap behind a COM vtable for interface I and returns the (single) owning reference.

The object is destroyed — and value dropped — when the last reference is released. Reference counting is atomic because native code may release from another thread (in which case value is dropped on that thread); the interface methods themselves are only ever invoked on the UI thread.