System.Win.ComObj.TComObject.ServerExceptionHandler

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property ServerExceptionHandler: IServerExceptionHandler

C++

__property _di_IServerExceptionHandler ServerExceptionHandler = {read=FServerExceptionHandler, write=FServerExceptionHandler};

Properties

Type Visibility Source Unit Parent
property public
System.Win.ComObj.pas
System.Win.ComObj.hpp
System.Win.ComObj TComObject

Description

Provides access to the SafeCall exception notification process.

The ServerExceptionHandler property provides a way for you to access the SafeCall exception notification process so that you can log or reroute those notifications to an external monitor. The monitor can be another object within the same COM server module, or it could be on a different machine entirely.

For example, server exception handlers could be implemented to:

  • Log COM server exceptions to the NT system event log
  • Write exceptions to a text file
  • Send email to an administrator
  • Alert support personnel through a pager

The ServerExceptionHandler property is useful for administering remote servers, particularly if a server is physically unreachable. For example, when an exception is raised in a COM object, if the server application is a VCL forms-based application (not just a DLL), then the VCL default exception handler may show a message box on the server. No client requests on that COM object instance can be serviced until the message box is closed. By reporting the exception to an event log, others can see the information from any remote location, as long as the remote users have access rights on the server.

Tip: The ServerExceptionHandler property would be particularly useful for COM objects (either stand-alone or those running in the MTS environment), that are used in active server pages. You can use the ServerExceptionHandler property to write exception information in HTML or in any other format you desire.

See Also