Shutdown

NOTE:  To build this sample in Visual Studio 2015 in a RTSSRelease configuration, you must add the following libraries in Properties > Input:

Description

Demonstrates the use of a system shutdown handler in an application.

Source Files

Shutdown project source file:

Build the Sample

  1. Open the solution in the desired Visual Studio version you wish to build.
  2. Once Visual Studio is open, build the sample in any desired RTSS configuration that is available

Run the Sample

  1. Run the Executable for RTSS. A tone should play and will continue until Windows is shut down.
  2. Upon shutting down, a message will be displayed and then a sleep for 10 seconds, after which the shutdown program will quit as well.

Remarks

The shutdown program should be built as an .rtss executable binary file and run in the real-time environment. The RTX API call RtAttachInterrupt will not run in the Win32 environment.

See also Shutdown Handling.

APIs Referenced

RTAPI

Win32 APIs

RtAttachShutdownHandler

RtCreateTimer

RtDeleteTimer

RtGetClockTimerPeriod

RtReleaseShutdownHandler

RtSetTimerRelative

SuspendThread

 

IntervalZero.com | Support | Give Feedback