INtime SDK Help
_CrtSetReportFile
INtime SDK v6 > About INtime > Other system libraries > Heaps and memory pools > Using the Debug Heap > _CrtSetReportFile

After specifying _CRTDBG_MODE_FILE with _CrtSetReportMode, you can specify the file handle to receive the message text. _CrtDbgReport also use _CrtSetReportFile to specify the text destination (debug version only).

int _CrtSetReportFile (
    int reportType, 
    int reportFile 
);

Parameters

reportType
Report type. Valid values include:
_CRT_WARN
_CRT_ERROR
_CRT_ASSERT
reportFile
New report file for reportType.

Remarks

You use _CrtSetReportFile with _CrtSetReportMode to define the destination(s) for a specific report type generated by _CrtDbgReport. When _CrtSetReportMode is called to assign the _CRTDBG_MODE_FILE reporting mode for a specific report type, _CrtSetReportFile should then be called to define the specific file or stream to use as the destination. When _DEBUG is not defined, preprocessing removes calls to _CrtSetReportFile.

The following lists available choices for reportFile and the resulting behavior of _CrtDbgReport. These options are defined as bit flags in crtdbg.h.

file handle
A handle to the message file destination. No attempt is made to verify the handle's validity. You must open and close the handle to the file.
_CRTDBG_FILE_STDERR
Writes message to stderr.
_CRTDBG_FILE_STDOUT
Writes message to stdout.
_CRTDBG_REPORT_FILE
Returns the current report mode.

The report file used by each report type can be separately controlled. For example, you can send a reportType of _CRT_ERROR to stderr, while sending a reportType of _CRT_ASSERT to a user-defined file handle or stream.

Return Values

On successful completion, _CrtSetReportFile returns the previous report file defined for the report type specified in reportFile.

Requirements

Versions Defined in Include Link to
INtime 3.13 intime/rt/include/crtdbg.h crtdbg.h clib.lib
   
See Also