Display an error message dialog
#include <Ap.h> void ApError( PtWidget_t *widget, int errnum, char const *app_prefix, char const *error_message, char const *location );
ApError() displays an error message dialog on the screen. This is a modeless dialog that doesn't wait for a user response. It displays a formatted error message and a single OK button for acknowledgment. The arguments are:
ApError() builds the message, in order, from the following:
If you call ApError() as follows, specifying the location,
ApError( ABW_base, errno, "PhAB", "Unable to save file", __FILE__ );
then the error dialog is formatted as:
PhAB: Unable to save file(Permission denied) in (save_function.c)
In the example above, __FILE__ is a compiler directive to insert the name of the source file, and (Permission denied) is the string associated with the current value of errno.
If you make the same call, but omit the location,
ApError( ABW_base, errno, "PhAB", "Unable to save file", NULL );
then the error dialog is formatted as:
PhAB: Unable to save file(Permission denied)
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PtMessage in the Widget Reference