setlocale(LC_ALL, "Russian");
char buffer[100];
HANDLE file;
bool isSucceed;
file = CreateFile(L"myfile.txt", GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
isSucceed = ReadFile(file, buffer, 10, 0, NULL);
if (!isSucceed) {
cout << "Файл не был прочитан!" << endl;
} else {
cout << "Файл прочитан! Ура!" << endl;
}