Opened 15 years ago

Closed 14 years ago

#2895 closed enhancement (fixed)

Add ability to attach CPLErrorHandler via C# swig bindings

Reported by: project10 Owned by: tamas
Priority: normal Milestone: 1.7.0
Component: CSharpBindings Version: svn-trunk
Severity: normal Keywords: csharp CPLSetErrorHandler
Cc:

Description

I would like to have the ability to register my own CPLErrorHandler via the C# SWIG bindings. Presumably this would involve passing in an appropriate delegate to a static Gdalconst method, which would in turn invoke CPLSetErrorHandler behind the scenes.

This would be used to read any log messages generated internally to GDAL/OGR - including any at debug levels, assuming that CPL_DEBUG is set appropriately.

I am unsure how this would play with "UseExceptions()", I assume that setting a custom error handler would override the error handler that UseExceptions uses to turn error messages into exceptions.

Attachments (1)

Program.cs (623 bytes ) - added by tamas 14 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 by tamas, 14 years ago

Added this support in r18358 see the usage example attached

by tamas, 14 years ago

Attachment: Program.cs added

comment:2 by tamas, 14 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.