This documentation is archived and is not being maintained.

CAtlFile::Create 

Call this method to create or open a file.


HRESULT Create(
   LPCTSTR szFilename,
   DWORD dwDesiredAccess,
   DWORD dwShareMode,
   DWORD dwCreationDisposition,
   DWORD dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL,
   LPSECURITY_ATTRIBUTES lpsa = NULL,
   HANDLE hTemplateFile = NULL 
) throw( );

Parameters

szFilename

The file name.

dwDesiredAccess

The desired access. See dwDesiredAccess in CreateFile in the Platform SDK.

dwShareMode

The share mode. See dwShareMode in CreateFile.

dwCreationDisposition

The creation disposition. See dwCreationDisposition in CreateFile.

dwFlagsAndAttributes

The flags and attributes. See dwFlagsAndAttributes in CreateFile.

lpsa

The security attributes. See lpSecurityAttributes in CreateFile.

hTemplateFile

The template file. See hTemplateFile in CreateFile.

Returns S_OK on success, or an error HRESULT on failure.

Calls CreateFile to create or open the file.

Show: