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

Quite easy!

Put 'On Error Goto 0' (zero) just before the raise event. this will 'reset' the error handler

Be aware of the 'Break in class modules' setting Should be Break on all unh...


    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



Tue, 03 Apr 2001 03:00:00 GMT  
 Problems when using Err.Raise in a public method of an activex
Your errors are being raised but you've told VB to On Error Resume Next...
think about it. You'll have to do an On Error Goto 0 before raising the
error if you expect it to get anywhere.

    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



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

Consider what's happening. When you do the Err.Raise, the On Error
Resume Next kicks in and execution continues at the next statement.

Regards
{*filter*}


    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



Tue, 03 Apr 2001 03:00:00 GMT  
 
 [ 4 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