添加第三方Dll参考visual studio 2012 [英] Add Third Party Dll reference to visual studio 2012

查看:91
本文介绍了添加第三方Dll参考visual studio 2012的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何将第三方dll(dll以 c 语言)添加到visual studio 2012.现在当我添加它时它会给我错误

dll可以添加。确保该文件是可访问的,这是一个有效的程序集或COM组件

how i can add third party dll(dll is in c language) to visual studio 2012. right now when i add it it gives me error that
"dll can be added. make sure that file is accessible and that is a valid assembly or COM component"

推荐答案

目前还不清楚你尝试做什么,但机会是,您尝试使用普通本机(非托管)Windows DLL。如果您的DLL是某个有效.NET程序集或COM组件的主模块,则可以使用添加引用窗口(COM组件的COM选项卡)添加引用。如果不是,您可以使用P / Invoke:

http://en.wikipedia.org/ wiki / Platform_Invocation_Services [ ^ ],

http://msdn.microsoft.com/en-us/library/ms235282.aspx [ ^ ]。



此CodeProject文章也很有用: Essential P /调用 [ ^ ] 。



-SA
It's not clear what did you try to do, but chances are, you tried to use a "plain" native (unmanaged) windows DLL. If your DLL is a main module of some valid .NET assembly or COM component, you can just add the reference using "Add Reference" window ("COM" tab for COM component). If it is not, you can use P/Invoke:
http://en.wikipedia.org/wiki/Platform_Invocation_Services[^],
http://msdn.microsoft.com/en-us/library/ms235282.aspx[^].

This CodeProject article can also be useful: Essential P/Invoke[^].

—SA


这篇关于添加第三方Dll参考visual studio 2012的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆