Export (0) Print
Expand All
3 out of 4 rated this helpful - Rate this topic

RTC Sample: Run-Time Error Checks 

Download sample

The RTC sample shows how to use the C run-time library's run-time error check feature.

When you load this project into the development environment, you will notice two custom build configurations:

No CRT

Does not use the C run-time library and, therefore, uses customized error reporting.

Normal

Uses the C run-time library and its error reporting mechanism.

Notice that the rtcsamp.cpp file contains the code that causes the bugs that are reported.

Security noteSecurity Note

This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.

Building and Running the Sample

NoteNote

If you are running Visual C++ Express Edition, you might need to install the Platform SDK before running this sample. For information on how to do this, see How to: Use Visual C++ Express Edition with the Microsoft Platform SDK.

To build and run this sample

  1. Open the solution rtcsample.sln.

  2. From the Build menu, click Build.

  3. From the Debug menu, select Start Without Debugging.

If you debug this project, you will see the Visual Studio debugger support for run-time error checks. That is, you will see the debugger's error reporting mechanism. The debugger's support for reporting run-time error checks is independent of whether you use the C run-time library.

Additional Information

For more information about run-time error checks, see the following topics:

Keywords

This sample uses the following keywords:

_RTC_error_fn; _RTC_ErrorNumber; _crt_rtc_init; _rtc_geterrdesc; _rtc_initialize; _rtc_seterrorfunc; _rtc_terminate; catch_rtc_failure; defined; interlockedexchange; intrinsic; messagebox; sleep; sprintf; strcat; strcpy; va_arg; va_end; va_start; vsprintf; winmain

See Also

Other Resources

General Samples

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.