Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6: API to clear label error handling
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
VFP6: API to clear label error handling
Miscellaneous
Thread ID:
00686532
Message ID:
00686532
Views:
108
I am trying to use this code to clear the volume label on a disk. I can not get the error handler (GetLastError) to work. If I try run this code with no disk in the drive the SetVolumeLabel still returns a 1. I am using Win98 and received the code from:
http://www.news2news.com/vfp/?example=151&function=221#codeexamples

DECLARE INTEGER GetLastError IN kernel32

DECLARE INTEGER SetVolumeLabel IN kernel32;
STRING lpRootPathName, STRING lpVolumeName

IF SetVolumeLabel ("A:\", "") = 0
* 3 = The system cannot find the path specified
* 5 = Access is denied
* 21 = The device is not ready
* 1235 = The request was aborted
? "Error code:", GetLastError()
ENDIF

Thanks!
DLC
"Use the Right Tool for the Job!"
davidandcynthia@email.com
Next
Reply
Map
View

Click here to load this message in the networking platform