LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call to WinAPI Kernel32.dll doesn't work in runtime

I have a dll call to the Kernel32.dll function GetVolumeInformationA. It works in the development environment and when I build it into an executable and run the executable on the development machine it also works, bu when I run the executable on the target machine with only the LabVIEW Runtime installed it does not run. It produces error code 21. Any ideas as to the cause of the problem?

Allen
0 Kudos
Message 1 of 5
(5,009 Views)
"CAW" wrote in message
news:5065000000080000007DC20000-1077587809000@exchange.ni.com...
> I have a dll call to the Kernel32.dll function GetVolumeInformationA.
> It works in the development environment and when I build it into an
> executable and run the executable on the development machine it also
> works, bu when I run the executable on the target machine with only
> the LabVIEW Runtime installed it does not run. It produces error code
> 21. Any ideas as to the cause of the problem?


Check if the dll versions are same on both machines. The Microsoft dll
history link is
http://support.microsoft.com/default.aspx?scid=http%3a%2f%2fsupport.microsoft.com%2fservicedesks%2ffileversion%2fdllinfo.asp&fp=1

HTH

************************
Mohan Pawar



>

> Allen
0 Kudos
Message 2 of 5
(5,009 Views)
Hi,

Your target and development machines are running different versions of windows?

In the call library function node of your VI diagram, make sure you have put "kernel32.dll" in the "Library Name or Path" entry and not a direct path to kernel32.dll like "C:\Windows\System\kernel32.dll". The kernel32.dll resides in C:\Windows\System for Win98 and C:\Windows\System32 for WinXP/2000.


I have attached VI's which perform the GetVolumeInformationA function. I tested the built application across both WinXP and Win98. The VI's are in LabVIEW 7, let me know if you need them in version 6.
Download All
0 Kudos
Message 3 of 5
(5,009 Views)
Hi Allen,

Here is a link that talks a little bit more about Error 21. If I understand your problem correctly, I would lean towards making sure that you have all of your DLLs on the target machine and that they are located in an accessible directory. Good Luck!

Jeremy L.
National Instruments
Jeremy L.
National Instruments
0 Kudos
Message 4 of 5
(5,008 Views)

Whether the volume serial number will be unique ? My requirement is to have a unique identification, of the PC in which I am running my program 

0 Kudos
Message 5 of 5
(4,356 Views)