如何为vb .net winform程序添加外部引用? [英] How to add external reference to a vb .net winform program?

查看:117
本文介绍了如何为vb .net winform程序添加外部引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将从Internet下载的外部库添加到vb .net winform项目中。当我在myComputer中浏览引用时,我可以找到该文件,当我单击OK时,我收到一条错误消息,指出无法添加引用。请确保该文件是可访问的,并且它是一个有效的程序集或COM组件。'谁能告诉我我做错了什么?

I am trying to add an external library that I downloaded from the internet to a vb .net winform project. I can find the file when I browse for the reference in myComputer, when I click OK I get an error saying that the reference 'could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.' Can anyone tell me what am I doing wrong?

推荐答案

该库您下载的不是基于COM的,也不是> NET库。这是一个标准的C型库,只有其中的功能。



你不能添加它的引用。



但是,您可以使用P / Invoke调用该库中的函数。这要求您知道函数的确切名称以及每个函数所需的参数的确切列表。没有工具可以告诉你这些事情。你必须有关于图书馆的文件才能使用它。



P / Invoke [ ^ ]
The library you downloaded is not COM-based or a >NET library. It's a standard C-type library with only functions in it.

You cannot add a reference to it.

You can, however, call the functions in that library using P/Invoke. This requires that you know the exact names of the functions and the exact list of parameters each of those functions expects. There is no tool that will tell you these things. You MUST Have the documentation on the library in order to use it.

P/Invoke[^]


这篇关于如何为vb .net winform程序添加外部引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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