I want to use CreateFile() function in Visual C++. when I am using it in this way:-
{
BOOL bTest=FALSE;
DWORD dwNumRead=0;
HANDLE hFile=CreateFile(L"D:\\a.dat",GENERIC_READ,FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,NULL);
bTest= CloseHandle(hFile);
}
The value of bTest is coming out to be False and the file is not created. Please, if possible, illustrate an example to create a file using CreateFile and tell me what I am doing wrong.