How to properly implement a COM DLL in Rust? Is there any minimal example?

I have a DLL that has registered the path to the registry key InprocServer32, and I've also been able to successfully call other 3rd party DLLs with the same interface via CoCreateInstance (most of them are written in C++ and not open source). But when I try to implement a new COM DLL of that interface in Rust, I run into problems. I have no previous experience implementing COM DLLs in C++, and I can't find any examples online of "how to implement COM with Rust", so I'm very confused right now. I know that there is an "implement" attribute macro in windows-rs, I have marked this macro, and all the methods of the interface are implemented. What should I do next so that CoCreateInstance can correctly create an instance of this interface and be called by the host exe?

1 Like