Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Caller Function Reference

Caller Function Reference

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpcomhelpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sameers Javed
    wrote on last edited by
    #1

    Is there any way to get reference of the caller function? In a program, a function calls to another which further calls to some other function and so on. In any function, is it possible that which function transferred controlled to current function? In .NET we can get the current function name using MethodInfo.GetCurrentMethod but this class (MethodInfo) doesn't support the parent function info which called this current method. We need to get that; Any suggestion/help will be appreciated. Thanks, Sameers Need custom software? Contact DevelopersINN[^] Need to add reminders for your Outlook emails? Try Outlook PA[^]

    G S 2 Replies Last reply
    0
    • S Sameers Javed

      Is there any way to get reference of the caller function? In a program, a function calls to another which further calls to some other function and so on. In any function, is it possible that which function transferred controlled to current function? In .NET we can get the current function name using MethodInfo.GetCurrentMethod but this class (MethodInfo) doesn't support the parent function info which called this current method. We need to get that; Any suggestion/help will be appreciated. Thanks, Sameers Need custom software? Contact DevelopersINN[^] Need to add reminders for your Outlook emails? Try Outlook PA[^]

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Normally, a method shouldn't be bothered with things like which method is calling it. Why do you think that you need that? The information is in the call stack. One method of getting that is to throw an exception and catch it, then you get an exception object that contains an analysis of the call stack. Not a very efficient method, though. --- b { font-weight: normal; } -- modified at 4:23 Sunday 8th January, 2006

      1 Reply Last reply
      0
      • S Sameers Javed

        Is there any way to get reference of the caller function? In a program, a function calls to another which further calls to some other function and so on. In any function, is it possible that which function transferred controlled to current function? In .NET we can get the current function name using MethodInfo.GetCurrentMethod but this class (MethodInfo) doesn't support the parent function info which called this current method. We need to get that; Any suggestion/help will be appreciated. Thanks, Sameers Need custom software? Contact DevelopersINN[^] Need to add reminders for your Outlook emails? Try Outlook PA[^]

        S Offline
        S Offline
        S Senthil Kumar
        wrote on last edited by
        #3

        See this[^] post. Regards Senthil _____________________________ My Blog | My Articles | WinMacro

        S 1 Reply Last reply
        0
        • S S Senthil Kumar

          See this[^] post. Regards Senthil _____________________________ My Blog | My Articles | WinMacro

          S Offline
          S Offline
          Sameers Javed
          wrote on last edited by
          #4

          Thanks for the link. It works. Great. Thanks again, Need custom software? Contact DevelopersINN[^] Need to add reminders for your Outlook emails? Try Outlook PA[^]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups