Last active
July 25, 2020 07:30
-
-
Save kennykerr/8f5606367cceaedd20b1fece1667a7a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
com::declare!( | |
// A COM interface | |
[uuid(...)] | |
pub interface IComInterface { | |
fn foo(&self); | |
fn bar(&self); | |
} | |
// A public COM class must have a [uuid] | |
[uuid(...)] | |
pub class PublicClass : IComInterface, bindings::IImportedInterface { | |
fields: file_types | |
} | |
// An internal COM class doesn't need a [uuid] | |
pub(crate) class PrivateClass : IComInterface { | |
fields: file_types | |
} | |
impl PublicClass { | |
// Used by IClassFactory::CreateInstance | |
fn new() -> Result<PublicClass> { | |
Self {...} | |
} | |
} | |
// How would this work? | |
impl IComInterface for PublicClass { | |
fn foo(&self) { | |
} | |
fn bar(&self) { | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment