Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with WriteFile
Message
From
22/10/2003 16:51:58
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Help with WriteFile
Miscellaneous
Thread ID:
00841292
Message ID:
00841292
Views:
42
Hi,

I'm having problems with the following code:

LOCAL lnWrite
lnWrite = 0

IF WriteFile(lnFile, lcVal, 1, @lnWrite, 0) <> 0

llRetVal = .T.
ENDIF

I'm getting a data mismatch error and I don't know why. Am I passing something incorrectly to writefile? Could be, I had a hard time finding examples on how to use writefile.

lnFile is the file handle, its a numeric value.
lcVal is just a single character.

Here is how I declare the API function:

DECLARE INTEGER WriteFile IN kernel32;
INTEGER hFile,;
INTEGER lpBuffer,;
INTEGER nBt2Write,;
INTEGER @lpBtWritten,;
INTEGER lpOverlapped

Thanks,
Chris
Next
Reply
Map
View

Click here to load this message in the networking platform