A couple of things to note here...
#1) Never get rid of your original example program 'cause someone's gonna
ask a question about it :-)
#2) For some reason the sample program was missing one line at the top:
DECLARE SetLastError IN "kernel32.dll" INTEGER test
I ran this under NT 4.0 and Win95 and both times I got by without any VFP
intervention... but ummm... I'm using 5.0 :-)
Ok.. You forced me to install 3.0b and try it.. sure enough input/output
failure... you'll be glad to know this doesn't happen in 5.0 <g>. Also I
noticed that the error message is different. (With FormatMessage()
command).
If a floppy is not in the drive:
Under 5.0, I get "The device is not ready"
Under 3.0, I get "The operation completed succesffully"
If a macintosh disk is in the drive (as close as I could come to an
unformatted disk <g> )
Under 5.0/Win95, I get "A device attached to the system is not
functioning"
Under 5.0/NT4, I get "The volume does not contain a recognized file
system. Please make sure that all required file system drivers are loaded
and that the volume is not corrupt."
Under 3.0, I get "A device attached to the system is not functioning"
So it looks like there's more work that needs to be done to this sucker to
get it to work better. (Such as trapping for VFP error 1002)...
Sigh..nothing is ever easy <g>
To answer your question about where to get the constants. I cheat.. I
looked in the WINBASE.H file that MSVC has to find the constant. Also, I
believe VB 4 had a utility to find a constant definition.
Finally, fix the last SETERRORMODE to say =SetErrorMode(0) instead of
=SetErrorMode(1) to restore it back to it's original setting.
-= Ken =-