Function winsafe::CoCreateInstance[][src]

pub fn CoCreateInstance<T: ComInterface>(
    clsid: &CLSID,
    iunk_outer: Option<&mut IUnknown>,
    cls_context: CLSCTX
) -> WinResult<T>
Expand description

CoCreateInstance function.

Returns an IUnknown-derived COM object.

Examples

Instantiating an ITaskbarList object:

use winsafe::{co, CoCreateInstance, shell};

let obj = CoCreateInstance::<shell::ITaskbarList>(
    &shell::clsid::TaskbarList,
    None,
    co::CLSCTX::INPROC_SERVER,
)?;