problem about com-interface-Collection of common programming errors


  • svick
    .net com-interop com-interface
    Following this article, I have successfully translated C++ COM class/interface declaration into C# like this:[InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid(IfaceGuid)] public interface IFoo {void Bar(); }[ComImport, Guid(ClassGuid)] public class Foo { }I use it like this:var foo = new Foo(); var ifoo = (IFoo)foo;ifoo.Bar();My question is, how can this possibly work, considering that Foo doesn’t implement IFoo (even at runtime, typeof(Foo).GetInterfaces() is empty) and that user-defin

Web site is in building