 ErrorHandler 1.02
 Copyright (c) 1998 SamSoft PTY LTD
 All Rights Reserved.
=============================================================


Table of Contents

1. System Requirements
2. Overview
3. Installation
4. Use
5. Example
=============================================================
1. System Requirements
Any Microsoft Windows operating system that supports 32 bit applications

=============================================================
2. Overview
ErrorHandler is an easy to use 32 bit COM component that helps 
you to handle exceptions in Visual Basic applications 
and  if the application is running on Windows NT platform, 
logs the error message or any other type of message( Warning, Success, Failure, Information etc.)
to NT's Event Log and register it under its application's name. It provides the following services:
a.	Displays meaningful error messages with the following information:
	i.	The module raising the error
	ii.	The subroutine raising the error
	iii.	The application raising the error and in case of an automation 								object, the name object. 
	iv.	Error number
	v.	Error description
	vi.	Programmers comments.	
				
b.	Detects the platform on which the application is running, and if 
	Windows NT, logs above information plus the UserID of the current user to 
	the  NT's event log.

c.	Logs any other type of event (Warning,Success, Failure, Information etc.) to  NT's Event 
	Log and register it under its own application's name.
=============================================================
3. Installation
1. Register ErrorHandler.dll by using regsvr32.dll or any other utility 
2. Open your VB project and select the menu item Project - References and check Samsoft Error Handler.

=============================================================
4. Use
 Access to the services of the ErrorHandler is via a single method - Raise.

Syntax: 
object.Raise SourceRoutine, ErrorType, errObj, SourceModule, Comments
The Raise method syntax has these parts:


Part		Description

object		Optional. An object of the type ErrorHandler.

SourceRoutine	String  - the name of the current subroutine 

ErrorType	Type of error  (select from an Enum list)

ErrObj 		An object of the type ErrObject (Just type in Err) 

SourceModule	A visual basic object  (Just type in App)

Comments 	Optional. String - Programmer's comments 

Remarks
You must supply Err and App as the third and fourth parameters respectively.

=============================================================
5. Example

This example displays a meaningful error message and logs useful 
information concerning this message plus the UswerId of the current user
to windows Event log, if the application is running on Windows NT platform. 
To run this example, put a CommandButton control on a form and name it 
ErrorHandlerTest. Then paste the example into ErrorHandlerTest_Click,
run the project and click the CommandButton.

Private Sub ErrorHandlerTest_Click()
Dim objError As New ErrorHandler
 	Dim testNo As Integer

 	On Error GoTo RaiseError
 	 testNo = "g"
 Exit Sub
 RaiseError:
	objError.Raise " ErrorHandlerTest_Click()", _
	EVENTLOG_ERROR_TYPE, Err, App,"Have assigned a string value to an integer variable"
End Sub

This example simply Logs any other type of event (Error,Warning, or Success event)
to  NT's Event	Log and register it under its own application's name. 
To run this example, put a CommandButton control on a form and name it 
ToEventLog. Then paste the example into ToEventLog_Click,
run the project and click the CommandButton.

Private Sub ToEventLog_Click()
Dim objError As New ErrorHandler
 	Dim testNo As Integer

 	On Error GoTo RaiseError
'the next line simply logs warning message to 
'NT event log without raising error.

	objError.Raise " ErrorHandlerTest_Click()", _
	EVENTLOG_WARNING_TYPE, Err, App,"About to assign a string to an integer variable"

 	 testNo = "g"
 Exit Sub
RaiseError:
	objError.Raise " ErrorHandlerTest_Click()", _
	EVENTLOG_ERROR_TYPE, Err, App,"Have assigned a string value to an integer variable"
End Sub