ProgrammingAce
01-24-2003, 10:28 PM
I used the following statement to create a file:
hFile = CreateFile(_T("\\My Documents\\DataFile.txt"), GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
The file appears in the proper directory as "DataFile", so I am assuming that the file has been created successfully and that the PocketPC OS hides the file extension. However, I know know how to write to that file. I am using the WriteFile function but have been unable to pass my string to lpBuffer (type is LPCVOID)properly.
WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, NULL);
Can someone explain how I pass my string to the WriteFile function properly?
hFile = CreateFile(_T("\\My Documents\\DataFile.txt"), GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
The file appears in the proper directory as "DataFile", so I am assuming that the file has been created successfully and that the PocketPC OS hides the file extension. However, I know know how to write to that file. I am using the WriteFile function but have been unable to pass my string to lpBuffer (type is LPCVOID)properly.
WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, NULL);
Can someone explain how I pass my string to the WriteFile function properly?