<< Click to Display Table of Contents >>

 

zetafax_logo

User supplied error message display function

 


 

Syntax

 

void ZFAPICALLBACK MyError( char FAR *lpszErrorText)

 

Parameters

 

Parameter

Description

lpszErrorText

Null terminated string containing explanatory text for error

 

Description

 

This routine should be defined within the application program itself - it can  have any name. Its address is passed as one of the parameters to ZfxAPIInit , and it is called by the API before the API routines return certain error  codes, to give additional text explaining why the call failed. For example, if  a SUBMIT file is rejected the API will call this routine with the reason,  before returning the error code ZFERR_SUBMIT_FILE_INVALID.

 

For programs which interact with the user the text is probably best displayed on  screen, as an additional help to any error message which the program itself may  display as a result of the returned error code. Other programs may wish to log  the error to disk or ignore it (defining an empty function) as required. Note  that a FAR (32-bit) pointer to the string is supplied - in 16 bit environments  the "%Fs" (or equivalent) format specifier will be needed in calls to printf  etc.

 

Return Value

 

There is no return value.

 

Example

 

#include <stdio.h>

#include <zfapi.h>

...

void ZFAPICALLBACK DisplayAPIError( char FAR *lpszText)

{

       /* Note - remember to use %Fs in 16 bit */

       /* programs because it is a FAR pointer */

       printf("*API ERROR* %Fs\n", lpszText);

}

 

Related topics

Alphabetical reference

Function error returns and reference