Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Customising Exception Message

Reply
 
Old 06-03-2008   #1 (permalink)
Pure Heart


 
 

Customising Exception Message


Hi

i implemented my own Eception Class inherting from System.ApplicationException
and i use properties such as

System.Reflection.Assembly.GetCallingAssembly.GetName.Version.ToString

to add information to the displayed message, what is so important to me is
to catch
the information about the procedure name and form name that caused the
exception and instead if passing it as arggument and then chnging the value
of string in each procedure and each from isnt there a system.reflection
property that stores that information ?

thank you
--
Ammar S. Mitoori
IT Head QIMCO Co.
Tel : +9744831199
Mobile : +9745378400
Fax : +9744831643

My System SpecsSystem Spec
Old 06-03-2008   #2 (permalink)
Alex Meleta


 
 

Re: Customising Exception Message

Hi,

To know a method name you can use Method.CurrentMethod (as well as use StackFrame
to analize calling procedures), but form's name comes from Form class properties,
so it depends on what means "name", easest way is to take a type.

Regards, Alex
[TechBlog] http://devkids.blogspot.com


My System SpecsSystem Spec
Old 06-04-2008   #3 (permalink)
Pure Heart


 
 

Re: Customising Exception Message

hi

do you mean this code
System.Reflection.MethodInfo.GetCurrentMethod.ToString
--
Ammar S. Mitoori
IT Head QIMCO Co.
Tel : +9744831199
Mobile : +9745378400
Fax : +9744831643


"Alex Meleta" wrote:
Quote:

> Hi,
>
> To know a method name you can use Method.CurrentMethod (as well as use StackFrame
> to analize calling procedures), but form's name comes from Form class properties,
> so it depends on what means "name", easest way is to take a type.
>
> Regards, Alex
> [TechBlog] http://devkids.blogspot.com
>
>
>
My System SpecsSystem Spec
Old 06-04-2008   #4 (permalink)
Alex Meleta


 
 

Re: Customising Exception Message

Hi Pure,

Yes, exactly.

Regards, Alex
[TechBlog] http://devkids.blogspot.com

PH> hi
PH>
PH> do you mean this code
PH> System.Reflection.MethodInfo.GetCurrentMethod.ToString
PH> "Alex Meleta" wrote:
PH>
Quote:
Quote:

>> Hi,
>>
>> To know a method name you can use Method.CurrentMethod (as well as
>> use StackFrame to analize calling procedures), but form's name comes
>> from Form class properties, so it depends on what means "name",
>> easest way is to take a type.
>>
>> Regards, Alex
>> [TechBlog] http://devkids.blogspot.com

My System SpecsSystem Spec
Old 06-09-2008   #5 (permalink)
Pure Heart


 
 

Re: Customising Exception Message

hi

when i used the line of code in last replay from me i got the text

"method name: 1.0.0.0" the method name text i added it but the value of it
1.0.0.0 comes from line of code i posted before so it dindt work properly ?
--
Ammar S. Mitoori
IT Head QIMCO Co.
Tel : +9744831199
Mobile : +9745378400
Fax : +9744831643


"Alex Meleta" wrote:
Quote:

> Hi Pure,
>
> Yes, exactly.
>
> Regards, Alex
> [TechBlog] http://devkids.blogspot.com
>
> PH> hi
> PH>
> PH> do you mean this code
> PH> System.Reflection.MethodInfo.GetCurrentMethod.ToString
> PH> "Alex Meleta" wrote:
> PH>
Quote:
Quote:

> >> Hi,
> >>
> >> To know a method name you can use Method.CurrentMethod (as well as
> >> use StackFrame to analize calling procedures), but form's name comes
> >> from Form class properties, so it depends on what means "name",
> >> easest way is to take a type.
> >>
> >> Regards, Alex
> >> [TechBlog] http://devkids.blogspot.com
>
>
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Exception processing message 0xc0000013 General Discussion
'Bad Image' Exception Processing Message Vista General
exception processing message Vista music pictures video
Exception Processing Message 0xc000007b Vista General
Exception Processing Message - Vista Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46