Adding DLL reference to VB.NET project

此生再无相见时 提交于 2019-12-07 10:50:17

问题


Just to start off, this question does seem very similar to another post Add the DLL (lame_enc.dll) reference to my project, but I haven't been able to successfully apply that answer. I am pretty new to VB.NET so it is very possible I'm simply missing something obvious.

I am trying to link a DLL to a VB.NET 2010 project to allow my VB app to play *.ogg files. I followed some other advice here on the forums and downloaded FMOD's FMOD Ex Programmers API. I am trying to now reference that functionality. These appear to be the files I need to somehow reference.

C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\fmodex64.dll.
C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\libfmodex64_vc.lib.

I haven't discovered how to add a *.lib reference (or the equivalent), but selecting the DLL as a reference gives the following error.

A reference to 'C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\fmodex64.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.

I'm not sure what I could be missing. Any ideas? Thanks!


回答1:


In Solution Explorer, double-click the My Project node for the project.

In the Project Designer, click the References tab.

Click the Add button to open the Add Reference dialog box.

In the Add Reference dialog box, select the tab indicating the type of component you want to reference.

Select the components you want to reference, then click OK.




回答2:


Another approach I was trying is working for me. I found a site with a working example of a LibZPlay VB.NET sample ( http://planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=7789&lngWId=10 ). It runs under VS 2008 and I was able to adapt my project to use LibZPlay (open source library http://libzplay.sourceforge.net/WELCOME.html ) under VS 2008.

That is sufficient for me for now. Thanks for your advice. It was likely some configuration issue or misunderstanding on my end.




回答3:


Using VB.net 2015 I (could not add or even find a System32 dll) as a reference using Solution Explorer, Tab References. Going to the MAIN Menu, Projects/Add References... Used Browse and All the System32 dll were visible. Then I was able to load the needed dll.



来源:https://stackoverflow.com/questions/11674944/adding-dll-reference-to-vb-net-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!