取消
显示结果 
搜索替代 
您的意思是: 

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 项奖励
1 条消息(共 5 条)
5,461 次查看
"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 项奖励
2 条消息(共 5 条)
5,461 次查看
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.
下载全部
0 项奖励
3 条消息(共 5 条)
5,461 次查看
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 项奖励
4 条消息(共 5 条)
5,460 次查看

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 项奖励
5 条消息(共 5 条)
4,808 次查看