C# How do you get an instance of a COM interface
I've been doing quite a bit of googling trying to find the standard way to get an instance of a COM interface. Microsoft provides an example of this in their article COM Interop Part 1: Client Tutorial : // Create an instance of a COM coclass: FilgraphManager graphManager = new FilgraphManager(); // See if it supports the IMediaControl COM interface. // Note that this will throw a System.InvalidCastException if // the cast fails. This is equivalent to QueryInterface for // COM objects: IMediaControl mc = (IMediaControl) graphManager; // Now you call a method on a COM interface: mc.Run();