PC Review


Reply
Thread Tools Rate Thread

Raiseevent inside catch block

 
 
RJ
Guest
Posts: n/a
 
      5th Apr 2006
Can you raise an event within a catch block in VB.NET ?( 1.1 Framework)

I am seeing some unexpected behavior in other parts of the WinForm app. I
just wondered if it is even "legal" to do this. TIA


 
Reply With Quote
 
 
 
 
Carl Daniel [VC++ MVP]
Guest
Posts: n/a
 
      5th Apr 2006
RJ wrote:
> Can you raise an event within a catch block in VB.NET ?( 1.1
> Framework)
> I am seeing some unexpected behavior in other parts of the WinForm
> app. I just wondered if it is even "legal" to do this. TIA


It certainly ought to be legal (caveat - I haven't personally verified that
for .NET 1.1, but it would be a serious flaw for this to be
illegal/undefined).

Inside the catch block the original exception is handled (no longer exists -
unless you re-throw it). Throwing a new exception from within the catch
should still run any associated finally block and begin a new handler search
starting in the scope that contains the try/catch.

-cd


 
Reply With Quote
 
Gozirra
Guest
Posts: n/a
 
      5th Apr 2006
I have raised events within a catch block in a service and within an
asp.net app without problems. As far as I know, its perfectly legal.
Unfortunately I have no experience doing this within a windows forms
app. What kind of unexpected behavior are you getting?

 
Reply With Quote
 
Gozirra
Guest
Posts: n/a
 
      5th Apr 2006
I have raised events within a catch block in a service and within an
asp.net app without problems. As far as I know, its perfectly legal.
Unfortunately I have no experience doing this within a windows forms
app. What kind of unexpected behavior are you getting?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
throw statement inside a catch block continually caught be same catchblock? Tracy Bannon Microsoft C# .NET 3 3rd Jan 2009 03:22 PM
CODING PRACTICE: Returning from function inside a TRY/CATCH block? Savvoulidis Iordanis Microsoft ASP .NET 7 20th Jul 2008 12:09 PM
try..catch catch the error only running inside of VS.NET Dragos Hilbert Microsoft C# .NET 2 11th Mar 2008 04:35 PM
Catch block is failing to catch exceptions when not run from MSDev CodeSlayer Microsoft C# .NET 2 16th Feb 2006 07:42 PM
Response.Redirect inside a Try Catch block Craig Microsoft Dot NET 2 15th Sep 2005 03:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:16 PM.