LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom dll not working in an executable

Solved!
Go to solution

I have a custom DLL that works fine when I run within the Labview environment.  However, when I create an executable it looks like it's not finding the DLL.  I get an Error 7.  Other times I have made an executable using the same DLL  with other Labview code, I get crashes saying there is an access violation 0xC0000005 and an apology for the inconvenience (which gets very irritating after awhile).  I have tried to "specify the path" within the Call Library Function Node and setting it to the exact folder, but nothing seems to work.  I have included the DLL in the same folder as the executable as well.  Any suggestions?? 

 

 

    Jodi

0 Kudos
Message 1 of 5
(2,338 Views)

When LabVIEW runtime loads DLLs and cannot find them, it asks for them with a dialog.

 

If you are getting an error from the library call node, the DLL was found.

 

If you get crashes with access violation, you have malfunctioning DLL code, that is accessing unallocated memory, double freeing and so on.

 

Edit: What kind of functionality does your DLL provide ?

 

0 Kudos
Message 2 of 5
(2,316 Views)

What compiler did you use to create the DLL? Did you install the correct version of the C  (or other) runtime library that your compiler undoubtly depends upon? When you compile a DLL, just about any C compiler will reference functions from it's runtime library, either because your code calls them explicitedly or because the compiler links in various startup and initialization code, that makes use of that library. On your development system the installation of the compiler also installed the necessary runtime libraries. On other computers it is quite likely that the according runtime libraries are not yet installed, so that loading your DLL will fail, since Windows can not find all dependencies of your library.

 

Read the documentation for your compiler and what runtime library distributions are required to be installed in order for any compiled library or executable to be loadable on other computers. For Visual C you will typically want to look for the C runtime redistributable installer which needs to be executed on every computer you want to be able to load your DLL.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 5
(2,300 Views)

The DLL is from a third party that accesses its own harware through a USB.  We've been having very odd behavior.  I had the executable finally working on our new computer but I had copied my entire project directory with the executable.  Then I decide to try and clean out the folder.  So I put all the *.vi in the recycling bin.  When I went to run the executable again, I get the access error and the inconvenience statement.  I restarted the computer and same thing.  Now nothing works again.  Any suggestions? 

 

 

   Thank you. 

 

     Jodi

0 Kudos
Message 4 of 5
(2,263 Views)
Solution
Accepted by topic author jschwartz100

This error is on our end.  This is a JTAG tester.  We went to test another board and it had a lot of errors retured through the DLL.  I'm assuming the buffer of the DLL did not have enough space.  I'm going to forward your messages to our third party vendor. 

 

  Thank you for your input. 

 

     Jodi

0 Kudos
Message 5 of 5
(2,260 Views)