You must invoke the COM component using reflection in .NET.

I need to determine the type of a COM component (unmanaged code) and call public methods of an interface using reflection in C # at runtime.

  • First, Which member "Type" tells that the type is a COM component and we can take the CLSID at runtime? Is Type.COMObject?
  • I need to call public interface methods that are called in unmanaged code using CoCreateInstance passing CLSID and REFID ... I am using InvokeMember but it returns null or 0 as an out parameter.

How do I pass a parameter in this case.? Do I need to pass a parameter? Because all my unmanaged COM code allows the last parameter to be taken as an OUT parameter, and after executing it, it emits the result into that parameter. But I converted all my unmanaged COM code to .NET managed assemblies using tlbimp.exe.

+2


a source to share


1 answer


This question was asked a year ago, so I don't know how relevant it is, but could it help? C # 4.0 'dynamic' does not set ref / out arguments



0


a source







All Articles