VB.Net using C DLL

2019-07-20 17:38发布

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:\Users\Kyle\Documents\Pelles C Projects\ROBOLIB\ROBOLIB.dll

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?

1条回答
相关推荐>>
2楼-- · 2019-07-20 18:36

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.

查看更多
登录 后发表回答