Disappearing Errors!!! 
Author Message
 Disappearing Errors!!!

I have a piece of code that uses standard error handling; the err
object is then passed to a VB ActiveX DLL for display via a MsgBox in a
standard format.

The problem is, the error is always blank with err.number = 0 at
runtime, but in interactive (Debug) mode, everything is fine. So at
runtime it seems the DLL call is working asynchronously, and that
program execution leaves the sub before the error gets displayed!

Any ideas? Responses via e-mail if it's not a problem, ta.

The code (sort of):

sub whatever()
on error goto err_handler
    ...
    some code
    ...
    exit sub

err_handler:
    call objDLL.DisplayError(err)
end sub

Sent via Deja.com http://www.*-*-*.com/
Share what you know. Learn what you don't.



Sun, 02 Dec 2001 03:00:00 GMT  
 Disappearing Errors!!!
I do not remember precisely, but inside objDLL.DisplayError(err)
Err is cleaned by VB -
the approach is not correct-
you need to take err.number and err.descr... inside handler
and transfer it to dll as parameters...

VB has only 1 Err object ever -

Quote:

> I have a piece of code that uses standard error handling; the err
> object is then passed to a VB ActiveX DLL for display via a MsgBox in a
> standard format.

> The problem is, the error is always blank with err.number = 0 at
> runtime, but in interactive (Debug) mode, everything is fine. So at
> runtime it seems the DLL call is working asynchronously, and that
> program execution leaves the sub before the error gets displayed!

> Any ideas? Responses via e-mail if it's not a problem, ta.

> The code (sort of):

> sub whatever()
> on error goto err_handler
>     ...
>     some code
>     ...
>     exit sub

> err_handler:
>     call objDLL.DisplayError(err)
> end sub

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

--



Sun, 02 Dec 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help: Disappearing TABS !!! ... Yes they just disappear !

2. Disappearing Tables, Queries, Forms etc

3. Primary Key Disappears

4. Disappearing totals on subform: WEIRD!!!

5. Disappearing SQL Syntax

6. The Amazing Disappearing Registry Key

7. fSetAccessWindow and disappearing Menu Bar

8. disappearing dates

9. Disappearing Posts

10. Compile error: Automation error, Error 32811: Unexpected error

11. Disappearing ActiveX controls

12. URGENT REPOST - Database disappeared !

 

 
Powered by phpBB® Forum Software