HANDLE hFile = CreateFile(wstFilePath.c_str(), // file name GENERIC_WRITE, // open for write 0, // do not share NULL, // default security CREATE_ALWAYS, // overwrite existing FILE_ATTRIBUTE_NORMAL,// normal file NULL); // no template if (hFile == INVALID_HANDLE_VALUE) { //Messabox here return (INT_PTR)TRUE; }
ofstream out(stFilePath, ios::out|ios::binary); if(!out) { //Messabox here return (INT_PTR)TRUE; }
wstFilePath
c_str
"C:\Users\[Your Username]\Desktop\Filename.Extension"
GetLastError
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)