#include "stdafx.h" #include #include using namespace std; int _tmain(int argc, _TCHAR* argv[]) { std::cout << "Hello"<< std::endl; HANDLE h; h = CreateFile ( "c:\\work\\abc.txt", // LPCTSTR lpFileName GENERIC_READ | GENERIC_WRITE, // DWORD dwDesiredAccess, 0, // DWORD dwShareMode, NULL, // LPSECURITY_ATTRIBUTES lpSecurityAttributes, CREATE_ALWAYS, // DWORD dwCreationDisposition, FILE_ATTRIBUTE_NORMAL, // DWORD dwFlagsAndAttributes, NULL // HANDLE hTemplateFile ); if (h == INVALID_HANDLE_VALUE) std::cout << "Chyba" << std::endl; else std::cout << "Otevreno" << std::endl; char str [101]; cin.getline (str, sizeof (str)-1); return 0; }