Strange UserControl behaviour when run-time error occurs 
Author Message
 Strange UserControl behaviour when run-time error occurs

I have written a VB6 program with a few graphic UserControls
compiled into the main project/exe.

Whenever a run-time error occurs (yes, I know I should write more
error-handling code, but let's ignore that for a moment), the pro-
gram behaves differently depending on whether it is running in the
IDE, a p-code .exe, and a native code .exe:

-  IDE: The normal run-time error box is displayed. No problems.

-  P-code .exe: Diagonal lines all over my UserControls. No run-time
                      error box. Program just shuts down.

-  Native code .exe: Diagonal lines all over my UserControls. The run-time
                      error box appears.

So it only works as expected in the IDE. If anyone knows what is
going on here and how to handle it so the p-code .exe will behave
as when the program runs in the IDE I would be most grateful.

Regards,

Joergen Bech



Mon, 18 Feb 2002 03:00:00 GMT  
 Strange UserControl behaviour when run-time error occurs
Joergen Bech heeft geschreven in bericht ...

Quote:

>-  IDE: The normal run-time error box is displayed. No problems.

>-  P-code .exe: Diagonal lines all over my UserControls. No run-time
>                      error box. Program just shuts down.

>-  Native code .exe: Diagonal lines all over my UserControls. The run-time
>                      error box appears.

Joergen,

I think this is normal behaviour.
When working from the IDE, VB is able to compile lines to be executed on the
fly (that's why you're able to alter code when in Break mode). But when your
application is compiled there is no way to enter Debug mode and VB
automatically crosses out the control(s) that caused the error - no sense in
calling a control that's keeps crashing all the time.

I don't know why the P-code variant just shuts down and the native variant
doesn't. Maybe that's documented somewhere. My guess is they should at least
behave the same.

-
--
Arjan D.W. de Haan
Quality SDC

           (remove .nospam when replying)

Opinions expressed are mine alone and need not reflect those of my employer
--
-



Mon, 18 Feb 2002 03:00:00 GMT  
 Strange UserControl behaviour when run-time error occurs

Quote:
> >-  IDE: The normal run-time error box is displayed. No problems.

> >-  P-code .exe: Diagonal lines all over my UserControls. No run-time
> >                      error box. Program just shuts down.

> >-  Native code .exe: Diagonal lines all over my UserControls. The
run-time
> >                      error box appears.

> Joergen,

> I think this is normal behaviour.
> When working from the IDE, VB is able to compile lines to be executed on
the
> fly (that's why you're able to alter code when in Break mode). But when
your
> application is compiled there is no way to enter Debug mode and VB
> automatically crosses out the control(s) that caused the error - no sense
in
> calling a control that's keeps crashing all the time.

> I don't know why the P-code variant just shuts down and the native variant
> doesn't. Maybe that's documented somewhere. My guess is they should at
least
> behave the same.

The thing is, we are not talking about a run-time error in the controls,
but a main form with several different UserControls which are all crossed
out when any run-time error occurs. I tested this by generating a simple
"division by 0" error when selecting a menu item. Yes, they should behave
the same, and the fact that they do not seems to indicate that the
interpreter
in the p-code version goes down before it gets the change to display the
error box?!?

I could, of course, compile it to native code and forget about it, but the
p-code version is only 1.6MB whereas the native one is 3MB, so ...

Joergen Bech



Mon, 18 Feb 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. runtime error 429 occurs for some strange reason

2. runtime error 429 occurs for some strange reason

3. UserControl: strange keyboard behaviour

4. VBScript Run-time Error 507 - An exception occurred

5. Strange Oracle error: ORA-06502 (and Microsoft run-time error -2147467259(80004005))

6. Strange Compile Errors at Run-time

7. strange run-time error

8. Tired: strange run-time error with VB component and ASP

9. A Strange Run Time Error in VB5 (SP2)

10. A Strange Run Time Error in VB5 (SP2).

11. Strange behaviour/error with .getrows and text columns

12. Microsoft Visual C++ Run time library Run time error R6025

 

 
Powered by phpBB® Forum Software