CFile::CFile

Use this constructor to construct a CFile object. The default constructor does not open a file but rather sets m_hFile to CFile::hFileNull. Because this constructor does not throw an exception, it does not make sense to use TRY/CATCH logic. Use the Open member function, then test directly for exception conditions.

Syntax

CFile( );

CFile( int hFile );

CFile( LPCTSTR lpszFileName, UINT nOpenFlags );
throw( CFileException );

At a Glance

Header File Afx.h
Platforms
Versions 1.0 and later
Complete documentation Visual C++ documentation

See Also

CFile Overview, CFile Member Functions, File Service Classes