i need to use writefile
BOOL WriteFile(
HANDLE hFile, // handle to file to write to
LPCVOID lpBuffer, // pointer to data to write to file -->should mean write_stuff
DWORD nNumberOfBytesToWrite, // number of bytes to write
LPDWORD lpNumberOfBytesWritten, // pointer to number of bytes written
LPOVERLAPPED lpOverlapped // pointer to structure needed for overlapped I/O
);
but don't know how to change wstring to lpcvoid ?
1 2 3 4 5 6 7 8 9 10 11
|
create = CreateFile(LP_filename, GENERIC_WRITE, FILE_SHARE_WRITE,
NULL, CREATE_ALWAYS,FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN |
FILE_FLAG_NO_BUFFERING, NULL);
wstring write_stuff = L"I am Happy" + write_stuff2 + write_stuff3 ;
HANDLE write ;
DWORD Bytes_that_need_To_Write;
LPDWORD bytes_which_have_written_already;
WriteFile( );
|
i don't know how to use WriteFile also..
i have read MSDN, but still don't understand..
Do i need to have a cycle operator--> while , when write a string to a file?
thanks very much