Download EzLIB API User Manual

Transcript
2.3.2 Writing to a file
long Array_TO_File(LPCVOID lpBuffer,
DWORD nBytesToWrite,
bool Flag);
This function writes data to the specified file. It copies a specified number of
bytes from the buffer that is pointed to by the nBytesToWrite parameter into
the file specified by the Start_FileIO function. Array_TO_File does not
perform any formatting on the data.
Parameter
lpBuffer
Range
Pointer to an array
nBytesToWrite 0 to 4,294,967,295
Flag
Return Value
0
Nonzero
true
false
Description
A pointer to the buffer containing the
data to be written to the file.
The number of bytes to write to the
file.
After the array has been written to the
file, determine whether to
• close the file – true or
• leave file open - false
Description
Execution was successful
Error: consult the error table at the appendix
Example:
typedef struct
{
BYTE TYPE;
long PARA;
long BB;
long WORK;
BYTE ARRAY[100];
}DEMO_Data;
//Define an array as buffer:
DEMO_Data DArray[100];
17