473,320 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Retrieving Class, Function and Procedure name; retrieving line number

Hello,

While logging the errors in my program, I want to know in which class,
function or procedure they occured.
Is it possible to know the name of the class, function and / or procedure in
which the error was produced? Is it also possible to know at which line
number of the program the error occured?

Many thanks and greetings,

Michel
Aug 10 '07 #1
3 1772
On Aug 10, 12:10 pm, "Michel Vanderbeke" <michel.vanderb...@skynet.be>
wrote:
Hello,

While logging the errors in my program, I want to know in which class,
function or procedure they occured.
Is it possible to know the name of the class, function and / or procedure in
which the error was produced? Is it also possible to know at which line
number of the program the error occured?

Many thanks and greetings,

Michel
In debug mode this information is available - see your other post
where I talk about the try...catch statement. You can gather most of
this information from the stacktrace property of the exception object.
In release mode however, most of this information is gone, as the
application has been compiled into IL and your app as you know it no
longer exists. You should do some experimenting on your own to see the
changes in stacktrace et al when you are in release mode compared to
debug mode.

Thanks,

Seth Rowe

Aug 10 '07 #2
On Aug 10, 12:27 pm, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Aug 10, 12:10 pm, "Michel Vanderbeke" <michel.vanderb...@skynet.be>
wrote:
Hello,
While logging the errors in my program, I want to know in which class,
function or procedure they occured.
Is it possible to know the name of the class, function and / or procedure in
which the error was produced? Is it also possible to know at which line
number of the program the error occured?
Many thanks and greetings,
Michel

In debug mode this information is available - see your other post
where I talk about the try...catch statement. You can gather most of
this information from the stacktrace property of the exception object.
In release mode however, most of this information is gone, as the
application has been compiled into IL and your app as you know it no
longer exists. You should do some experimenting on your own to see the
changes in stacktrace et al when you are in release mode compared to
debug mode.

Thanks,

Seth Rowe
I should also add that you should group similar posts together into
one post. This allows much easy discussion and enables future users to
find information in the archive easier.

Thanks,

Seth Rowe

Aug 10 '07 #3
There is a good example at
http://www.codeproject.com/dotnet/ExceptionHandling.asp for doing a stack
trace. Although coded for 1.1 the stack trace code works fine in 2.x.

"Michel Vanderbeke" <mi***************@skynet.bewrote in message
news:46***********************@news.skynet.be...
Hello,

While logging the errors in my program, I want to know in which class,
function or procedure they occured.
Is it possible to know the name of the class, function and / or procedure
in which the error was produced? Is it also possible to know at which
line number of the program the error occured?

Many thanks and greetings,

Michel


Aug 10 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Wojciech Wendrychowicz | last post by:
Hello to All, I'm trying to retrieve records from AS/400 in an VBA application. So, I've made an RPG program, then a stored procedure wchich calls that RPG program, and finally some VBA code to...
8
by: MLH | last post by:
Have a look at the procedure below. In particular, note lines 1 and 21... Private Sub JudHrngReqBtn_Click() On Error GoTo Err_JudHrngReqBtn_Click Dim ThisForm As String ThisForm = Me.Name ...
35
by: NickName | last post by:
I understand it's easy to list all saved queries of a given Access database via Msysobjects system table. However, I have not seen any posting over this NG or other similar ones that also include...
1
by: tangus via DotNetMonster.com | last post by:
Hello all, I'm really struggling with getting some Active Directory code to work in ASP.NET. Can you please provide assistance? I am executing the following code: Dim enTry As DirectoryEntry =...
5
by: jan axelson | last post by:
My application is using RegisterDeviceNotification() to detect attachment and removal of a USB HID-class device. The form is receiving WM_DEVICECHANGE messages with wParam set to...
5
by: Jeff Cobelli | last post by:
I am trying to include two classes as members of another class in a webservice. The definitions look basically like this: Public Class clsLender Public ID As String Public Name As String End...
2
by: timpera2501 | last post by:
I am a newb to OOP programming and I'm only just starting with C#. I've done a TON of reading lately, and I'm currently in the process of modifying some of the function provided by the...
8
by: Chad | last post by:
To anyone who is smarter than I am when it comes to WMI: Here is what I am trying to do: 1) Detect a USB pen drive when it is inserted 2) Retrieve the drive letter of the pen drive 3) Check...
0
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.