Home |
RTTarget-32 Programming Manual Function RTT_Init_MSC8CRT System Management BIOS (SMBIOS) Advanced Programmable Interrupt Controller (APIC) |
Function RTT_Init_MSC8CRTPrograms compiled with Microsoft Visual Studio 2005 or higher should call this function at program initialization in order to reduce the stack requirement and exception raising if errors in the run-time system are reported. void RTT_Init_MSC8CRT(void); RTT_Init_MSC8CRT calls _set_invalid_parameter_handler() to install an invalid parameter handler which uses OutputDebugString() to display an error message and then continue program execution. In addition, the run-time system functions _CrtDbgReport() and _CrtDbgReportW() are replaced with functions that need only very little stack space to display the report, also using OutputDebugString(). The Microsoft versions of these functions need up to 64k stack space. Example:int main(void) { #if _MSC_VER >= 1400 // Keep MSC 8.0 run-time library happy RTT_Init_MSC8CRT(); #endif ... The debug run-time libraries of Microsoft C versions earlier than 8 (_MSC_VER < 1400) may also require a lot of stack space in _CrtDbgReport(). If you prefer to use RTTarget-32's stack space-optimized version, but do not need the custom invalid parameter handler, add option /include:__CrtDbgReport to the linker command line. This works with all versions of Microsoft Visual C++.
|