Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

VBAIInterfaceC.dll could not be found on 64-bit machine

Solved!
Go to solution

I'm currently trying to run a vbai program with .net like in the DotNET examples included in the "API Examples" map. I added the NationalInstruments.VBAI.2008 to my References in visual studio 2008 and the program runs fine on my Windows XP SP3 32bit system. When I run the program on a Windows 7 32bit machine it also runs but when I test it on a Windows 7 64bit the program crashes as soon as I try to run this line of code:

 

VBAIEngine engine =newVBAIEngine("Engine"string.Empty, false);

 

I get the error:

 

System.DllNotFoundException: Can't load DLL VBAIInterfaceC.dll.

 

Is this is a 64 bit problem cause when I look up the dll file I find it on 32bit machines in the folder C:\Windows\System32 and in the 64bit machine it is in the C:\Windows\SysWOW64 folder.

 

Do I use the wrong DLL files or is there something else I should consider using 64bit?

 

Thank you in advance for any help.

0 Kudos
Message 1 of 3
(4,123 Views)
Solution
Accepted by topic author declercq_tom@waak.be

You must configure your 64-bit MSVC project to run in 32-bit mode so it will find the 32-bit dll in the 32-bit Windows\SysWOW64 directory. You should be able to go to Build>>Configuration Manager... and set the Platform to x86. The directions may be slightly different for different versions of MSVC, so these are the directions for MSVC 2010. I found this here:

http://julester.hubpages.com/hub/How-to-run-a-Visual-Studio-2010-application-as-32-but-on-a-64-bit-m...

 

Hope this helps,

Brad

Message 2 of 3
(4,117 Views)

Just to add some clarification -

 

By default .NET applications are built as "AnyCPU" which means that the runtime compiles it on-the-fly for 32 or 64-bit mode depending on the host OS whenever it is run (from the single binary). This is in contrast to a typical compiled C/C++/LabVIEW application where the bitness is fixed.

 

As Brad mentioned, right now the VBAI API DLLs are only released as 32-bit binaries, so you need to ensure your application using them always runs in 32-bit mode. This is simply a compile option that sets a flag in the resulting binary.

 

Eric

Message 3 of 3
(4,115 Views)