I try to create a file with this code :

DWORD dwWritten;

HANDLE myNewFile;

try

{

myNewFile = CreateFile(newFileName,

GENERIC_WRITE,

FILE_SHARE_WRITE,

NULL,

CREATE_NEW,

FILE_ATTRIBUTE_NORMAL,

NULL);

WriteFile(myNewFile,

&pDouble,

myFile.GetLength(),

&dwWritten,

NULL);

CloseHandle(myNewFile);

}

catch (CDaoException* e)

{

AfxMessageBox(e->m_pErrorInfo->m_strDescription);

e->Delete();

}

But no file is created!!!

The compiler says there is no error and no warning.

Could anyone help me find what's wrong in the code?


Thanks a lot.