开发者

Need to call COM component using reflection in .NET

I need to determine the COM component(unmanaged code) type and invoke the exposed interface's methods using reflection in C# at runtime.

  1. First What member of "Type" tells that type is COM component and we can take CLSID at runtime? Is Type.COMObject?
  2. I need to call methods of exposed interfaces as they called in unmanaged code using CoCreateInstance by passing开发者_如何转开发 CLSID and REFID ... I am using InvokeMember but it returns null or 0 as out parameter.

How to pass out parameter in this case.? Is there any need to pass out parameter? As all my COM unmanaged code suppose to take last parameter as an OUT parameter and after executing it puts the result into that out param. But I've converted all my unmanaged COM code to .NET managed assemblies using tlbimp.exe.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜