Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Difference between vfox6 & 8
Message
De
23/11/2012 05:16:38
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Difference between vfox6 & 8
Divers
Thread ID:
01557845
Message ID:
01557845
Vues:
117
The following function works in vfox 8 and not in 6.
Any reason why ?
FUNCTION checkreadrights
LPARAMETERS cFile
DECLARE Integer CreateFile IN WIN32API ;
   String lpFilename, ;
   Integer dwDesiredAccess, ;
   Integer dwShareMode, ;
   Integer lpSecurityAttributes_optional, ;
   Integer dwCreateDisposition, ;
   Integer dwFlagsAndAttributes, ;
   Integer hTemplateFile_option

DECLARE INTEGER CloseHandle IN WIN32API ;
   Integer hHandle

DECLARE INTEGER GetLastError IN kernel32.DLL

DECLARE INTEGER FormatMessage IN kernel32.dll INTEGER, STRING, INTEGER, INTEGER, STRING@, INTEGER, STRING

#DEFINE WIN98_DELETE      0x00010000
#DEFINE WIN98_WRITE       0x40000000

#DEFINE FILE_SHARE_DELETE 0X00000004
#DEFINE FILE_SHARE_READ   0X00000001
#DEFINE FILE_SHARE_WRITE  0X00000002
#DEFINE FILE_FLAG_BACKUP_SEMANTICS 0x02000000

#DEFINE CREATE_NEW        0X00000001
#DEFINE CREATE_ALWAYS     0X00000002
#DEFINE OPEN_EXISTING     0X00000003
#DEFINE OPEN_ALWAYS       0X00000004
#DEFINE TRUNCATE_EXISTING 0X00000005

#DEFINE GENERIC_READ      0x80000000

LOCAL nHandle, cReturn, lFile[1], nSize

nHandle = CreateFile(cFile, IIF(VAL(OS(3)) < 5, WIN98_DELETE + WIN98_WRITE, GENERIC_READ),  ;
   0, ;
   0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0)

IF nHandle <> -1 
   LReturn = .T.
   CloseHandle(nHandle)
ELSE
	LReturn = .F.
ENDIF 	
RETURN LReturn 
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform