5

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!

6
  • Have you a x86 or x64 System? It seems you installed in Program Files (x86) but with a libfmodex64_vc.lib (I wonder if x64 stand for the version or not?) In this case, you may find a solution in installing the right version in the right place. Commented Jul 26, 2012 at 17:56
  • I'm running Windows 7 64-bit. That location was the default location the FMOD installer fmodapi44200win-installer.exe prompted for an installation path. I'm guessing that the installer is a 32-bit executable, so windows defaulted to the x86 folder. I've moved the dll to the application folder, but it made no difference. Commented Jul 26, 2012 at 18:40
  • is your project set up to compile as x86 or x64? You can check this by opening VS 2010 then go to project-> properties, then click on the compile tab, there should be a button on the bottom labeled "Advanced Compile Options..." click that to open a new screen. In there if "Target CPU" is set to x86 or AnyCPU you may want to set it to x64 if you can and try adding the reference again. If you can't set it to x64 then you may need to download the 32-bit version of the dll and use that instead. Commented Jul 26, 2012 at 19:18
  • I've tried changing the compile target, but there was no effect. I've tried it on a WindowsXP 32-bit machine with VS 2008 with a brand-new WPF project and trying to add a reference to c:\windows\system32\user32.dll. Should this work? Does it work if you try it? Commented Jul 26, 2012 at 20:00
  • i didn't try it with this specific DLL but that solution has worked for me in the past. does anything change if you move the DLL to the SysWOW64 folder in the windows directory and try adding the reference to that location? Commented Jul 27, 2012 at 14:26

3 Answers 3

9

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.