title: CreateFile function in Visual C++
body: <p>I want to use CreateFile() function in Visual C++. when I am using it in this way:-</p>
  
  <pre><code>{
  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);
  }
  </code></pre>
  
  <p>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.</p>