Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locked removable
Message
De
24/10/2003 03:09:28
 
 
À
24/10/2003 02:44:50
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00840941
Message ID:
00841964
Vues:
33
Agnes,

You are welcome

>Gregory,
>
>thank you very much. It works perfectely.
>
>
>Agnes
>>Hi Agnes,
>>
>>You were right, it may happen. And the message comes from within the OS as noticed: see http://support.microsoft.com/default.aspx?scid=kb;en-us;192304
>>
>>If you uncomment the line indicated you will get the dialog (do not forget to make the diskette readonly)
>>
>>If you leave that line commented, you will not get the dialogue
>>
>>
>>
>>*---------------------------------------------------------------------------
>>function do_it()
>>
>>	?DriveReadOnly('A')
>>
>>endfunc
>>*---------------------------------------------------------------------------
>>#DEFINE SEM_FAILCRITICALERRORS      0x0001
>>#DEFINE SEM_NOGPFAULTERRORBOX       0x0002
>>#DEFINE SEM_NOALIGNMENTFAULTEXCEPT  0x0004
>>#DEFINE SEM_NOOPENFILEERRORBOX      0x8000
>>
>>function DriveReadOnly(DriveLetter)
>>
>>	DECLARE INTEGER SetErrorMode IN win32api INTEGER
>>	
>>	do case
>>	case len(DriveLetter) == 1
>>		DriveLetter = DriveLetter + ':'
>>	endcase
>>	
>>	local n, FileName, fd, DriveReadOnly
>>	n = SetErrorMode(0)
>>	=SetErrorMode( bitor(n, SEM_FAILCRITICALERRORS) )
>>	
>>	&& uncomment following line to get the dialogue
>>	&&=SetErrorMode( bitand(n, bitnot(SEM_FAILCRITICALERRORS)) )
>>	
>>	FileName = addbs(DriveLetter) + sys(3)
>>	
>>	fd = fcreate(FileName)
>>	do case
>>	case fd < 0
>>		DriveReadOnly = TRUE
>>	
>>	otherwise
>>		DriveReadOnly = FALSE
>>		=fclose(fd)
>>		delete file (FileName)
>>		
>>	endcase
>>	
>>	=SetErrorMode(n)
>>	
>>	return DriveReadOnly
>>endfunc
>>*---------------------------------------------------------------------------
>>
>>>Hi Gregory,
>>>
>>>now I'm getting confused.
>>>
>>>I'can not reproduce the FCREATE without dialog!
>>>
>>>I simply set my USB stick to R/O und try fcreate I get -1. I've changed to an other instance of VFP and start to run all my enviromental setting. Nothing happens. (I get the dialog)
>>>Now I've changed back to my first instance, run the line again and - I got this dialog!
>>>
>>>This Message must be produced from within my OS, because the message is plain german and my VFP8.0 SP1 is non german IDE. Normaly all excepted YES NO RETRY CANCEL will be english.
>>>
>>>Agnes
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform