Breaking News

Wednesday, August 27, 2008

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]);

No comments:

Post a Comment

Designed By Published.. Blogger Templates