Feature Post

Top

How to call a COM object method from C#

Calling a COM object method in C#, see following

Type comType = Type.GetTypeFromCLSID(someClassID);

object comInstance = Activator.CreateInstance(comType);

comType.InvokeMember(someMethodName, BindingFlags.InvokeMethod |

BindingFlags.IgnoreReturn | BindingFlags.Public, null, comInstance, new
object[0]);