Share via


CAtlFile Class

This class provides a thin wrapper around the Windows file-handling API.

Important

This class and its members cannot be used in applications that execute in the Windows Runtime.

class CAtlFile : public CHandle

Members

Public Constructors

Name

Description

CAtlFile::CAtlFile

The constructor.

Public Methods

Name

Description

CAtlFile::Create

Call this method to create or open a file.

CAtlFile::Flush

Call this method to clear the buffers for the file and cause all buffered data to be written to the file.

CAtlFile::GetOverlappedResult

Call this method to get the results of an overlapped operation on the file.

CAtlFile::GetPosition

Call this method to get the current file pointer position from the file.

CAtlFile::GetSize

Call this method to get the size in bytes of the file.

CAtlFile::LockRange

Call this method to lock a region in the file to prevent other processes from accessing it.

CAtlFile::Read

Call this method to read data from a file starting at the position indicated by the file pointer.

CAtlFile::Seek

Call this method to move the file pointer of the file.

CAtlFile::SetSize

Call this method to set the size of the file.

CAtlFile::UnlockRange

Call this method to unlock a region of the file.

CAtlFile::Write

Call this method to write data to the file starting at the position indicated by the file pointer.

Protected Data Members

Name

Description

CAtlFile::m_pTM

Pointer to CAtlTransactionManager object

Remarks

Use this class when file-handling needs are relatively simple, but more abstraction than the Windows API provides is required, without including MFC dependencies.

Inheritance Hierarchy

CHandle

CAtlFile

Requirements

Header: atlfile.h

See Also

Reference

CHandle Class

Concepts

Marquee Sample

Other Resources

ATL Class Overview