I have a bunch of COM objects which all implement the same interface, and need to create one of them as chosen at runtime from a list of options. Since I know the CLSID for
Two suggestions.
Use [STAThread] attribute.
[STAThread] static void Main(string[] args) {...}
Try calling CoInitialize
[DllImport("ole32.dll")] static extern int CoInitialize(IntPtr pvRes); CoInitialize((System.IntPtr)null)