简体   繁体   中英

How can I add a COM reference without using Visual Studio?

也许我必须在csc命令行上使用一些选项?

You need to generate an interop assembly for the COM library you want to use, and reference that assembly instead of the COM dll. You can generate the interop wrapper with Aximp.exe (for ActiveX controls) or Tlbimp.exe (for other COM components)

您应该使用TlbImp.exe实用程序从COM类型库生成一个互操作程序集,并使用/r编译器开关添加对生成的程序集的引用。

I have used Aximp.exe and Tlbimp.exe in one of my projects to generate the interop assemblies (to overcome COM component version difficulties) and a BAT file with the calls and comments is available. The interop assemblies still need to be referenced in the Visual Studio project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM