Crate com[][src]

Expand description

A helper crate for consuming and producing COM interfaces.


To work with a COM interface it must first be declared:

/// Define an IAnimal interface
com::interfaces! {
    pub unsafe interface IAnimal: com::interfaces::IUnknown {
        unsafe fn Eat(&self) -> com::sys::HRESULT;

To define a COM implementation class:

com::class! {
    pub class BritishShortHairCat: IAnimal {
        num_owners: u32,

    impl IAnimal for BritishShortHairCat {
        fn Eat(&self) -> com::sys::HRESULT {

See the examples directory in the repository for more examples.


Common COM interfaces including IUknown and IClassFactory

Functionality for producing COM classes

COM runtime facilities

Types for interacting with COM related system APIs


Declare COM implementation classes

A macro for declaring a COM server to the COM runtime

Declare COM interfaces


A COM method parameter used to accept either a reference or value.


Types that are safe to transfer over a COM API boundary.

A COM compliant interface pointer

Type Definitions

A class ID

An interface ID