473,569 Members | 2,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reflection possible on the call stack?

Is it possible to use reflection to get the name of methods on the call
stack as well as their supplied parameters and method signatures? Thanks in
advance.

Best wishes,
j^2
Nov 16 '05 #1
2 4224
On 03 Jul 2004 04:45, "J.J. Feminella" wrote:
Is it possible to use reflection to get the name of methods on the call
stack as well as their supplied parameters and method signatures? Thanks in
advance.

Best wishes,
j^2


Yoy can certainly get the call stack and the individual class and method
names. From there, you can use reflection to get MethodInfo (or similar)
information about each one of them. I don't believe that you can get the
values of any parameters, though, except for the current one.

--
Simon Smith
simon dot s at ghytred dot com
www.ghytred.com/NewsLook - NNTP Client for Outlook
Nov 16 '05 #2
On 03 Jul 2004 04:45, "J.J. Feminella" wrote:
Is it possible to use reflection to get the name of methods on the call
stack as well as their supplied parameters and method signatures? Thanks in
advance.

Best wishes,
j^2


Yoy can certainly get the call stack and the individual class and method
names. From there, you can use reflection to get MethodInfo (or similar)
information about each one of them. I don't believe that you can get the
values of any parameters, though, except for the current one.

--
Simon Smith
simon dot s at ghytred dot com
www.ghytred.com/NewsLook - NNTP Client for Outlook
Nov 16 '05 #3

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

Similar topics

2
323
by: djp | last post by:
Hi, I'm trying to access fields that are local to a method using reflection. What BindingFlags value should I use and is this possible at all. So far I was able to retreive class fields only. Thanks
1
1228
by: Good Enchiladas | last post by:
Is it possible to determine a method's own attributes from within the method without hardcoding the name of the method as a constant within the method? Please tell me if it is possible and how it is done. Thank you, Kelly
0
276
by: J.J. Feminella | last post by:
Is it possible to use reflection to get the name of methods on the call stack as well as their supplied parameters and method signatures? Thanks in advance. Best wishes, j^2
2
4318
by: brianlanning | last post by:
I'm trying to write a function that can reliably know the name of the calling method. I've figured out how to do this: string methodname = (new StackTrace()).GetFrame(1).GetMethod().Name; This seems to get the name of the method that called the current method. But there are two problems. One is that I have to hardcode one step back in...
1
1992
by: Marco | last post by:
Hi all I am using .NET reflection to examine a stack trace, using the StackTrace, StackFrame, MethodInfo, ParameterInfo and FieldInfo classes. I can easily discover all methods in the call chain and discover their parameter names and types. What I would like to do is also know the values that were passed to the
0
1144
by: Berger | last post by:
Hello I have a C# webservice which calls c# class dll´s using reflection. One class should produce pdf reports. All works fine. Now I have read that in the web.config the compilation debug parameter should be set to false. When I set this parmeter to false I´ve got an exception when I try to generate the Pdf report. The exception:...
10
4361
by: pedrito | last post by:
I have a library I'm using that has a lapsed listener issue. I figured I'd just sneak in and do the unsubscription myself since I don't expect it to be fixed any time soon. So, I have the control whose event its subscribed to and it's subscribed to the VisibleChanged event and has an event handler called ControlVisibleChanged. So...
1
1428
by: John | last post by:
I am trying to figure out how to translate the following CIL call into an Emit statement. In CIL it is: IL_004c: callvirt instance class System.Data.DataRow System.Data.DataRowCollection::get_Item(int32) The C# equivilant is as follows: MyDataRowCollection;
7
2668
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file name based on the name of the VB6 application. A second choice would be a file name based on the # COM interface assembly. I have tried calling...
0
7694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7921
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6278
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.