Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ExceptForm Exception Handling :)
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00847522
Message ID:
00849483
Views:
27
>/* Below line writen for raise run-time SystemException::Exception */
>//-------------------------------------------------------------------
>object rnd;
>rnd = new System.Random();
>foo(rnd); /* foo has one object type argument.
> * but foo will type conversiton to o paramater
> * System.Text.Encoding its not possible and
> * throw SystemException.*/
>//-------------------------------------------------------------------
>
>and now trying in catch block and show ExceptionForm;
>
>mmAppBase.Log.WriteException(e);
>// Display the Exception form /*its parts of your sample code.*/
>mmExceptionForm ExceptForm = new mmExceptionForm(e.Message, e.StackTrace);

You can just throw a new exception and the default error manager will catch it and display the exception form for you. Here's a sample:
try
{
  int iVar = int.Parse("ABC");
}
catch (System.Exception ex)
{
  throw (ex);
}
However, if you really need to handle this yourself, you need to make sure you call the Show() method of the form.
try
{
  int iVar = int.Parse("ABC");
}
catch (System.Exception ex)
{
  mmExceptionForm ExceptForm = new mmExceptionForm(ex.Message, ex.StackTrace);
  ExceptForm.Show();}
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform