如何在 Visual Studio 中添加对本机 COM 库的引用?
要添加本机引用,请使用“添加引用”命令,然后浏览 到清单。
因此,我尝试引用 Skype4COM 库。我使用 mt 生成了清单 工具。但是当我尝试引用这个清单时,VS 告诉我:
。
我理解了什么或者我做错了什么?
There is the Deploying COM Components with ClickOnce article in MSDN that says that native DLLs also could be referenced:
To add a native reference, use the Add Reference command, then browse
to the manifest.
So, I'm trying to reference Skype4COM library. I've generated a manifest using mt
tool. But when I try to reference this manifest, VS says me:
.
What am I understand or I'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将部署与构建混淆了。添加引用需要类型库或包含嵌入在 DLL 中的类型库的 DLL。 Skype4com.dll 有一个,但它有一个问题,无法通过“添加引用”对话框添加它。
使用“开始”+“程序”菜单中的 Visual Studio 命令提示符。使用 cd 导航到正确的目录并输入 tlbimp skype4com.dll。只要您运行 32 位代码,您就会收到一条警告,可以忽略该警告。返回 VS 并使用“添加引用”、“浏览”选项卡并选择生成的 SKYPE4COMLib.dll 文件。
You are mixing up deploying with building. Adding a reference requires a type library or a DLL that contains a type library embedded inside the DLL. Skype4com.dll has one but it has a problem which prevents it from being added through the Add Reference dialog.
Use the Visual Studio Command Prompt from the Start + Programs menu. Use cd to navigate to the correct directory and type tlbimp skype4com.dll. You'll get a warning that you can ignore as long as you are running 32-bit code. Go back to VS and use Add Reference, Browse tab and select the generated SKYPE4COMLib.dll file.