VB.Net使用C DLL [英] VB.Net using C DLL

查看:151
本文介绍了VB.Net使用C DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是把用C语言编写成VB.NET(前preSS版2010)项目中的DLL的最佳方式?我对外部功能定位的绝对路径,现在像这样的声明:

What is the best way to put a DLL written in C into a VB.NET (Express Edition 2010) project? I have the declarations for the external functions locating absolute paths right now like so:

C:\\用户\\凯尔\\文档\\ PellesÇ项目\\ ROBOLIB \\ ROBOLIB.dll

C:\Users\Kyle\Documents\Pelles C Projects\ROBOLIB\ROBOLIB.dll

由于Visual Basic创建这么多不同的目录中的程序可以从运行(调试,发布,出版)。有什么办法,我可以告诉VB.NET一些文件到程序的目录?或者我应该以某种方式自定义安装程序,以便它把我在一个特定的位置需要?

Because Visual Basic creates so many different directories the program could be running from (Debug, Release, Publish). Is there any way I could tell VB.NET to some files into the program's directory? Or should I somehow customize the installer so it puts the DLLs I need in a specific location?

推荐答案

您可以将DLL添加到您的项目(每个拖放或点击鼠标右键 - >添加 - >现有元素)。如果你右击该文件,选择属性,你可以定义复制到输出目录。

You can add the DLL to your project (either per Drag'n'Drop or right mouse click -> Add -> Existing Element). If you right click the file and choose properties, you can define "Copy to output directory".

当然,你应确保安装程序(如果你创建一个)复制这些文件。

Of course, you should ensure that the installer (in case you create one) copies the files.

这篇关于VB.Net使用C DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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