共用方式為


CFileException::ThrowErrno

Constructs a CFileException object corresponding to a given nErrno value, then throws the exception.

static void PASCAL ThrowErrno(
   int nErrno, 
      LPCTSTR lpszFileName = NULL
);

Parameters

  • nErrno
    An integer error code as defined in the run-time include file ERRNO.H.

  • lpszFileName
    A pointer to the string containing the name of the file that caused the exception, if available.

Example

CFileException::ThrowErrno(EACCES);  // "access denied"

Requirements

Header: afx.h

See Also

Concepts

CFileException Class

CFileException Members

Hierarchy Chart

CFileException::ThrowOsError