Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CreateFile() error in Windows 98
Message
From
14/03/2002 15:23:22
Joel Leach
Memorial Business Systems, Inc.
Tennessee, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
CreateFile() error in Windows 98
Miscellaneous
Thread ID:
00633002
Message ID:
00633002
Views:
52
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.
Joel Leach
Microsoft Certified Professional
Blog: http://www.joelleach.net
Next
Reply
Map
View

Click here to load this message in the networking platform