术语 | CException::ReportError | ||||
释义 | CException::ReportError virtual int ReportError(UINT nType = MB_OK, UINT nMessageID = 0); 返回值: 一个AfxMessage值。如果没有足够的内存来显示消息框,则返回0。请参阅AfxMessageBox,了解可能的返回值。 参数:
说明: 调用此成员函数在消息框中向用户报告出错文本。 示例: 以下是一个使用此函数的例子: CFile fileInput; CFileException ex; // try to open a file for reading. // The file will certainly not // exist because there are too many explicit // directories in the name. // if the call to Open() fails, ex will be // initialized with exception // information. the call to ex.ReportError() will // display an appropriate // error message to the user, such as // "\\Too\\Many\\Bad\\Dirs.DAT contains an // invalid path." The error message text will be // appropriate for the // file name and error condition. if (!fileInput.Open("\\\\Too\\\\Many\\\\Bad\\\\Dirs.DAT", CFile::modeRead, &ex)) { ex.ReportError(); } else { // the file was opened, so do whatever work // with fileInput we were planning... // : fileInput.Close(); } 请参阅:AfxMessageBox, CException::GetErrorMessage |
||||
随便看 |
|
MFC类库中文详解手册包含4274条MFC类库参考词条,基本涵盖了Microsoft基本类库中的类、全局函数、全局变量和宏的内容,是计算机编程的有利工具。