Write the contents of a buffer to an open file, with SetAnsi() dependency.
XSharp.Core (in XSharp.Core.dll) Version: 2.5
ptrHandle AS IntPtr,
ptrBuffer AS BYTE,
dwBytes AS DWORD
) AS DWORD
public static uint FWriteText3(
- Type: IntPtr
The handle of the file to write to.
- Type: Byte
A pointer to the buffer to write.
- Type: UInt32
The number of bytes in <ptrBuffer> to write, beginning at the current file pointer position.
The number of bytes written.
If the value returned is equal to <dwBytes>, the operation was successful.
If the return value is less than <dwBytes> or 0, this means that the length of <ptrBuffer> is less than <dwBytes>, or the disk is full, or another error has occurred. FError() can be used to determine the specific error.
FWriteText3() is the same as FWrite3() except that an ANSI to OEM conversion is made if SetAnsi() is FALSE.
This example writes the contents of a PSZ to a file.
1LOCAL pszBuff AS PSZ
2LOCAL ptrHandle AS PTR
3pszBuff := "hello"
4ptrHandle := FOpen2("temp.bin", FO_READWRITE)
5IF ptrHandle != F_ERROR
6 FWriteText3(ptrHandle, pszBuff, PszLen(pszBuff))