Re: Odd error trapping

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks a bunch!


"TrtnJohn" <TrtnJohn@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1808F650-7915-46C5-ABC5-5DDBA68BAF9A@xxxxxxxxxxxxxxxx
> No. Application.Exit just signals the message loop for the current
> application to terminate. The loop can't terminate until you return
> control
> to it. Try adding an Exit Sub after the Application.Exit so you can
> return
> control back to the caller. (I assume this code is inside some Click
> event
> handler or such).
>
> "Jon" wrote:
>
>> It appears that application.exit isn't doing what I think it should be
>> doing. The line oRpt.SetupReportDatabase() causes an except and the
>> exception is caught and the messagebox with the error message pops up, as
>> it
>> should. However, the application does not exit, and the MsgBox("Making
>> params") is executed from the next block of code and execution continues
>> on.
>> Am I doing something wrong? Shouldn't application.exit immediately stop
>> the
>> program. Thanks for any insight!
>>
>> I have the following code:
>>
>> Try
>> MsgBox("Enter create report")
>> oRpt = New
>> MSIReporting.MSICrystal(strNewReport,
>> DBName, AppSettings("WOServer"), AppSettings("WOLogin"),
>> AppSettings("WOPassword"))
>>
>> MsgBox("Exit create report")
>>
>> MsgBox("Set up report DB")
>> oRpt.SetupReportDatabase(DBName,
>> AppSettings("WOServer"), AppSettings("WOLogin"),
>> AppSettings("WOPassword"))
>> MsgBox("Done report db")
>> Catch ex As Exception
>> MsgBox("APPEXIT " + ex.Message)
>>
>> Application.Exit()
>> End Try
>>
>> Try
>> MsgBox("Making params")
>>
>> ReDim oCRParamsName(1, 1)
>> oCRParamsName(0, 0) = "WO"
>> oCRParamsName(0, 1) = drRow(3)
>>
>>
>>


.



Relevant Pages

  • Re: how to turn off NX bit in assembly?
    ... code using the faults to stop execution in an additional controlled ... Instead of unmapping and flush a page upon a page fault and loading another ... one could terminate the program at that point. ... they could interrupt on flow control. ...
    (alt.lang.asm)
  • Re: how to turn off NX bit in assembly?
    ... code using the faults to stop execution in an additional controlled ... one could terminate the program at that point. ... probably look at the debug registers to see what control of code they ... the ACPI doesn't distinguish apps ...
    (alt.lang.asm)
  • Error handling in DBPs
    ... We all know what the manual says about errors in database procedures: ... - The procedure continues execution with the statement following the ... Some errors terminate the procedure and ... control returns immediately to the calling program. ...
    (comp.databases.ingres)
  • Re: Return after AppActivate
    ... If I can terminate it then a message should be no big deal. ... from the TechNet Script library .. ... One such non-standard actX control for calling api's is called ... "DynaWrap", and that can be found on Gunter Born's website. ...
    (microsoft.public.scripting.wsh)
  • Re: Message Loops and Application.Run()
    ... >> what kind of messages would you like to send to the message loop without ... >> window? ... thread, instantiate the control. ... and vice-versa be wrapped in Invoke or BeginInvoke statements. ...
    (microsoft.public.dotnet.framework)