简体   繁体   English

在C#项目中使用COM dll

[英]Using COM dll in a C# Project

I have all COM dll generated from a C++ library project. 我有从C ++库项目生成的所有COM dll。 I want to use it in my C# project. 我想在我的C#项目中使用它。 I guess, I should import the xxxLib.dll file from the C++ library project, and import it to my C# project. 我想,我应该从C ++库项目中导入xxxLib.dll文件,并将其导入到我的C#项目中。 But this xxxLib.dll is not generated in my C++ project. 但是,此xxxLib.dll不是在我的C ++项目中生成的。 But I could see that xxx.dll and xxx.tlb are generated 但我可以看到生成了xxx.dll和xxx.tlb

You just register the dll with regsvr32 . 您只需使用regsvr32注册dll。

Then add a reference, go to the COM tab, and choose your COM dll. 然后添加引用,转到“ COM”选项卡,然后选择您的COM dll。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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