#include "stdafx.h" #include <windows.h> #include <iostream> #include <string> using namespace std; int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ) { HANDLE hFile; DWORD dwBytesRead, dwBytesWritten, dwPos; TCHAR szMsg[1000]; hFile = CreateFile (("File.txt"), // Open File.txt. GENERIC_WRITE, // Open for writing 0, // Do not share NULL, // No security OPEN_ALWAYS, // Open or create FILE_ATTRIBUTE_NORMAL, // Normal file NULL); // No template file if (hFile == INVALID_HANDLE_VALUE) { wsprintf (szMsg, TEXT("Could not open File.txt")); CloseHandle (hFile); // Close the file. return 0; } return 0; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)