| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2004.05.25 20:08 "Re: SetErrorHandler", by Frank WarmerdamRienstra, Jan-Harm wrote: > Hi, > > I've a question how to set the error handler (and warning handler too). > I use a function "writeToLog(char * logStr)" for my application. And I want > to submit the errors and warnings created by libtiff to the same logfile > using my writeToLog function. (And suppress the popup error messages). > > I've tried several possibilities with the SetErrorHandler function but I > don't know exactly how to define the TIFFErrorHandler. Could anyone give > some example code how to set the errorhandler to your "own function" > > BTW, I use BCB 6 on a win XP platform > > Regards, > > Jan Harm Rienstra > _______________________________________________ > Tiff mailing list > Tiff@remotesensing.org > http://remotesensing.org/mailman/listinfo/tiff > Jan, I use: /************************************************************************/ /* GTiffWarningHandler() */ /************************************************************************/ void GTiffErrorHandler(const char* module, const char* fmt, va_list ap ) { char *pszModFmt; pszModFmt = PrepareTIFFErrorFormat( module, fmt ); CPLErrorV( CE_Failure, CPLE_AppDefined, pszModFmt, ap ); CPLFree( pszModFmt ); } ... TIFFSetErrorHandler( GTiffErrorHandler ); ... Best regards, -- ---------------------------------------+-------------------------------------- I set the clouds in motion - turn up | Frank Warmerdam, warmerdam@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush | Geospatial Programmer for Rent |
|||||||