Problems when using Err.Raise in a public method of an activex 
Author Message
 Problems when using Err.Raise in a public method of an activex

Hi

I am having trouble when using Err.Raise in a public method of an activex.
I am using "On Error Resume Next"  to perform inline error checking.  When
an error occurs  I am raising an error with :

Err.Raise vbObjectError+ lErrorCode,"MyModule","MyFunction"

The amazing thing is that the client (an ASP page or a vb client)  that
creates the object and invokes my method never receives a valid Err object.
In fact it is empty.

If I replace the "On Error Resume Next" with "On Error Goto ErrorHandler"
and if I raise an error with the same manner it will work !!!!

What I am doing wrong ?

Thanks for your help



Mon, 02 Apr 2001 03:00:00 GMT  
 Problems when using Err.Raise in a public method of an activex


Hi

I am having trouble when using Err.Raise in a public method of an activex.
I am using "On Error Resume Next"  to perform inline error checking.  When
an error occurs  I am raising an error with :

Err.Raise vbObjectError+ lErrorCode,"MyModule","MyFunction"

The amazing thing is that the client (an ASP page or a vb client)  that
creates the object and invokes my method never receives a valid Err object.
In fact it is empty.

If I replace the "On Error Resume Next" with "On Error Goto ErrorHandler"
and if I raise an error with the same manner it will work !!!!

What I am doing wrong ?

Nothing.  That's the way it is supposed to work.  The only place you should be using On Error Resume Next is in situations where you're not going to handle the error for some reason, or if there is an error you are going to just abort the process completely.  In other words, you just check for Err.Number being greater than zero, and if so you abort.  Otherwise you should have an error handling routine, because that's the way VB was designed to handle errors.

jdm



Tue, 03 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problems when using Err.Raise in a public method of an activex

2. Problems when using Err.Raise in a public method of an activex

3. using err.raise method, as to generate app error

4. Err.Raise in OLE Server EXE not raising error in calling program

5. Err.Raise - error not being re-raised all the way to top of the call stack

6. err.raise in ActiveX component - newbie

7. CDO Problem using the GetMessage method to find a message in a Public Folder

8. Problems with Err.Raise in a class module.

9. Problem with Err.Raise and ByRef output arguments.

10. Err.Raise Problem

11. Problem using and ACTIVEX method from ASP

12. Problem using and ACTIVEX method from ASP

 

 
Powered by phpBB® Forum Software