473,406 Members | 2,713 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,406 software developers and data experts.

Identity calling class?

Hi

Having a system where I'm being called from clients (applications), I need
to identity the calling method and class as this class is decorated with
custom attributes I need to perform some logic dependant on this custom
attribute.

How do I in robust manner identify the calling methods class? The callstack
is different each time meaning I unfortunately can't use a specific fixed
stackframe index...

Thanks!

/Ole
Nov 17 '05 #1
2 1241
Never mind. Figured it out using an iteration of the stacktrace...
"Ole Hanson" <no@spam.com> wrote in message
news:un**************@TK2MSFTNGP15.phx.gbl...
Hi

Having a system where I'm being called from clients (applications), I need
to identity the calling method and class as this class is decorated with
custom attributes I need to perform some logic dependant on this custom
attribute.

How do I in robust manner identify the calling methods class? The
callstack is different each time meaning I unfortunately can't use a
specific fixed stackframe index...

Thanks!

/Ole

Nov 17 '05 #2
Ole Hanson a écrit :
Never mind. Figured it out using an iteration of the stacktrace...


"Ole Hanson" <no@spam.com> wrote in message
news:un**************@TK2MSFTNGP15.phx.gbl...
Hi

Having a system where I'm being called from clients (applications), I need
to identity the calling method and class as this class is decorated with
custom attributes I need to perform some logic dependant on this custom
attribute.

How do I in robust manner identify the calling methods class? The
callstack is different each time meaning I unfortunately can't use a
specific fixed stackframe index...

Thanks!

/Ole


Hello,
could you give some details? I'm running into the same problem. I would
like to know the class and method calling a method. How can you access
the stacktrace?

Thank you
Julien

Nov 17 '05 #3

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

Similar topics

3
by: José Joye | last post by:
I have written a .NET remoting app and I would like to know the identity of the client that calls my Server. Is there a way to do it? Or do I have to pass it as parameter in each of the method...
3
by: acg | last post by:
If you have a class with a public method, and another class which will want to call this method, is there a way to determine the type of the calling class within the method being called? For I...
7
by: JJ | last post by:
Hi, I call a class in my windows service app and in that class I access a method that returns an OleDbReader. Now It does have records in the reader when I step through the method but when I...
7
by: John | last post by:
Hi I have two distinct classes A & B. I am using class B from within Class A as follows; Public Class clsClassA Friend ClassB As new ClassB Public Sub New()
12
by: scottt | last post by:
hi, I am having a little problem passing in reference of my calling class (in my ..exe)into a DLL. Both programs are C# and what I am trying to do is pass a reference to my one class into a DLL...
4
by: ssg31415926 | last post by:
I want to write a logging method. I want it to log the name of the calling class and method. Is there any way to do this? I presume it'll use Reflection but it's not an area I've used much.a ...
2
by: ambujnema | last post by:
When I am calling C# dll into Vb6.0 through Server.CreateObject (“ClassLibrary1.Class1”). I stuck at one place; I have to pass some parameter in that class, Class contain two methods, in which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.