Skip to content

Instantly share code, notes, and snippets.

@kennykerr
Last active July 25, 2020 07:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennykerr/8f5606367cceaedd20b1fece1667a7a0 to your computer and use it in GitHub Desktop.
Save kennykerr/8f5606367cceaedd20b1fece1667a7a0 to your computer and use it in GitHub Desktop.
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