Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CreateFile() error in Windows 98
Message
 
 
À
14/03/2002 15:23:22
Joel Leach
Memorial Business Systems, Inc.
Tennessie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00633002
Message ID:
00633460
Vues:
20
It works for me under Win98SE.

>I downloaded some code from MSDN for getting the creation date of a file. Here is a piece of that code:
>
>* DEFINEs for file share mode.
>#Define FILE_SHARE_READ 1
>#Define FILE_SHARE_WRITE 2
>
>* DEFINEs for access right
>#Define GENERIC_READ hex2dec("80000000")
>#Define GENERIC_WRITE hex2dec("40000000")
>
>* DEFINES for Create Mode.
>#Define CREATE_NEW  1
>#Define CREATE_ALWAYS 2
>#Define OPEN_EXISTING 3
>#Define OPEN_ALWAYS 4
>#Define TRUNCATE_EXISTING 5
>
>* File flag.
>#Define FILE_ATTRIBUTE_NORMAL hex2dec("80")
>
>Declare Integer CreateFile In kernel32 ;
>	STRING lpFileName, ;
>	INTEGER dwDesiredAccess, ;
>	INTEGER dwShareMode, ;
>	INTEGER lpSecurityAttributes, ;
>	INTEGER dwCreationDisposition, ;
>	INTEGER dwFlagsAndAttributes, ;
>	INTEGER hTemplateFile
>
>...
>
>lhFileHandle = CreateFile(lcFileName, GENERIC_READ, ;
>	FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
>
>The CreateFile() function works in Windows XP, but fails in Windows 98 and returns Error 87 ERROR_INVALID_PARAMETER. The file in question is being accessed over a network share. I'm stumped. I couldn't find anything in the documentation or knowledgebase indicating an incompatibility with Win98. Any help would be appreciated. In the meantime, I'm going to try the outdated OpenFile() function.
>
>Thanks.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform