ImageGear for C and C++ on Linux v18.8 - Updated
IG_warning_set
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Warning Functions > IG_warning_set

This function places an ImageGear warning onto the error stack.

Declaration:

 
Copy Code
AT_ERRCODE ACCUAPI IG_warning_set(
   const LPSTR szFileName,
   INT iLineNumber,
   AT_ERRCODE iCode,
   AT_INT lValue1,
   AT_INT lValue2,
   const LPSTR szWarning
);

Arguments:

Name Type Description
szFileName const LPSTR Pointer to a string that supplies the name of the module from which the warning was generated. It is recommended that you use the _FILE_ constant in this field.
iLineNumber INT An integer telling ImageGear from which line the warning was set. It is recommended that you use the _LINE_ constant in this field.
iCode AT_ERRCODE An integer value of type AT_ERRCODE. Set this to the code number of the warning that you wish to place on the error stack.
lValue1 AT_INT The first argument that supplies any supporting information about the warning. Your application might use this value to decide what to do after setting a particular kind of warning.
lValue2 AT_INT The second argument that supplies any supporting information about the warning. Your application might use this value to decide what to do after setting a particular kind of warning.
szWarning const LPSTR Additional text description of the warning. It can be NULL if it is not available.

Return Value:

Returns the code of the ImageGear error that occurred during this function call. A value of zero means no errors have occurred. Errors that occurred during this function call are not appended onto the error stack.

Supported Raster Image Formats:

This function does not process image pixels.

Example:

 
Copy Code
static const AT_ERRCODE MYWARNING = (IGE_LAST_ERROR_NUMBER - 2);
AT_ERRCOUNT nErrcount = IG_warning_set(__FILE__, __LINE__, MYWARNING, 0, 0, "Warning message");

Remarks:

If you are setting a warning code that you have defined yourself, you must make sure that it has a value less than ImageGear's IGE_LAST_ERROR_NUMBER. As the defined value of IGE_LAST_ERROR_NUMBER may change in the future, you should define your warning codes relatively to IGE_LAST_ERROR_NUMBER, as demonstrated in the example, rather than use literal values.