Rethrow
  Home FAQ Contact Sign in
 
Advanced search
MATCHING GROUPS



more...
POPULAR GROUPS

more...

found 126 articles for 0.304 sec
For example... Public Sub OpenFile(sFile As String) On Error GoTo OpenError iFileNo = FreeFile() Open sFile For Input As #iFileNo Exit Sub OpenError: ' Clean up locally iFileNo = -1 ' Re-raise the error for someone else further up the stack Err.Raise Err.Number, Err.Source, Err.Description, Err.HelpFile, Err.HelpContext End Sub Tony Proctor     

Group: microsoft.public.vb.general.discussion · Group Profile · Search for Rethrow in microsoft.public.vb.general.discussion
Author: Tony Proctor
Date: Jul 11, 2007 08:08

> There is no problem here. Everything is working exactly as it should be. test1 and test2 should have identical results. They do not, therefore everything is NOT working exactly as it should be. void test1() { int *p=NULL; *p=0; } void test2() { try { int *p=NULL; *p=0; } catch(...) { throw; } } The c++/delphi excpetion conversion
Show full article (0.64Kb) · Show article thread
"Eric Noel" <eric.no@spam.rcs100.com> wrote in message news:4574b337$1@newsgroups.borland.com... > I agree with Clayton, rethrowing exceptions is dicey. Rethrowing a > normal vcl Exception seems to work ok (as long as it is caught as an > Exception and not ...) But rethrowing a divide by 0 or null pointer > access, etc gets turned into EEFFACE. There is nothing wrong with that. EEFFACE     

Group: microsoft.public.vb.general.discussion · Group Profile · Search for Rethrow in microsoft.public.vb.general.discussion
Author: MikeD
Date: Jul 10, 2007 13:08

> Also, always catch VCL exceptions by const reference: I have seen your comments about catching const before. One cannot always catch const because TObject is not written to work as a const object. Consider the following: catch (Exception const& E) { ShowMessage(E.ClassName()); } That is merely because the exception is making its way up the call stack to the VCL's
Show full article (0.32Kb) · Show article thread
"Clayton Arends" <nospam_claytonarends@hotmail.com> wrote in message news:4571b04b$1@newsgroups.borland.com... > However, if I use "catch (Exception& E) { throw E; }" instead then that > results in "Exception EDivByZero in module ...". You can't re-throw exceptions like that. You have to call 'throw' without any parameters to re-throw the existing exception. That works the same for VCL     

Group: borland.public.cppbuilder.vcl.components.using · Group Profile · Search for Rethrow in borland.public.cppbuilder.vcl.components.using
Author: Eric Noel
Date: Dec 4, 2006 16:57

Thanks for the info. So looks like I definitely need to be careful rethrowing VCL exceptions. I thought about auto_ptr after I made the post. Never used it before but I'll look into using it. "Clayton Arends" <nospam_claytonarends@hotmail.com> wrote in message news:4571b4f1@newsgroups.borland.com... So, to sum up! Try to structure your code such that you use catch only to end the life
Show full article (0.54Kb) · Show article thread
For the example you gave the use of a smart pointer is what you want to use in C++. #include <memory> { AllocatedResource = new TVCLObject(); //does not have to be VCL Object std::auto_ptr<TVCLObject> auto_AllocatedResource(AllocatedResource); { ... } } As for the help documentation I'm not sure what they mean. Following is an example of catching a system exception     

Group: borland.public.cppbuilder.vcl.components.using · Group Profile · Search for Rethrow in borland.public.cppbuilder.vcl.components.using
Author: Remy Lebeau (TeamB)
Date: Dec 4, 2006 16:22

Show full article (0.59Kb)
    

Group: borland.public.cppbuilder.vcl.components.using · Group Profile · Search for Rethrow in borland.public.cppbuilder.vcl.components.using
Author: Eric Noel
Date: Dec 4, 2006 15:46

Show full article (0.24Kb) · Show article thread
    

Group: borland.public.cppbuilder.vcl.components.using · Group Profile · Search for Rethrow in borland.public.cppbuilder.vcl.components.using
Author: Clayton Arends
Date: Dec 4, 2006 14:12

Show full article (0.64Kb)
    

Group: borland.public.cppbuilder.vcl.components.using · Group Profile · Search for Rethrow in borland.public.cppbuilder.vcl.components.using
Author: Remy Lebeau (TeamB)
Date: Dec 4, 2006 11:58

Show full article (0.95Kb)
    

Group: borland.public.cppbuilder.vcl.components.using · Group Profile · Search for Rethrow in borland.public.cppbuilder.vcl.components.using
Author: Remy Lebeau (TeamB)
Date: Dec 4, 2006 11:54

Show full article (0.38Kb) · Show article thread
    

Group: borland.public.cppbuilder.vcl.components.using · Group Profile · Search for Rethrow in borland.public.cppbuilder.vcl.components.using
Author: William Riley
Date: Dec 2, 2006 20:05

Show full article (0.70Kb)
    

Group: borland.public.cppbuilder.vcl.components.using · Group Profile · Search for Rethrow in borland.public.cppbuilder.vcl.components.using
Author: Clayton Arends
Date: Dec 2, 2006 08:57

Show full article (3.00Kb) · Show article thread
1 · 2 · 3 · 4 · 5 · 6 · 7 · 8 · 9 · next