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. C / C++ / MFC
  4. Function name macro

Function name macro

Scheduled Pinned Locked Moved C / C++ / MFC
debuggingquestion
3 Posts 2 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.
  • M Offline
    M Offline
    Mike Beckerleg
    wrote on last edited by
    #1

    Is there a way to get a function name in a macro? Something similar to __FILE__. Basically I use the class name and function name in debug statements through-out my code and I want a way to automate the insertion of these values. Ideally I want the values at compile time. Thanks Mike

    A 1 Reply Last reply
    0
    • M Mike Beckerleg

      Is there a way to get a function name in a macro? Something similar to __FILE__. Basically I use the class name and function name in debug statements through-out my code and I want a way to automate the insertion of these values. Ideally I want the values at compile time. Thanks Mike

      A Offline
      A Offline
      Anthony_Yio
      wrote on last edited by
      #2

      Functor or pointer to function? Not sure if this is the thing you want. Sonork 100.41263:Anthony_Yio

      M 1 Reply Last reply
      0
      • A Anthony_Yio

        Functor or pointer to function? Not sure if this is the thing you want. Sonork 100.41263:Anthony_Yio

        M Offline
        M Offline
        Mike Beckerleg
        wrote on last edited by
        #3

        What I want is the function name as a string. What I currently use is DB((_T("ClassName::MethodName Some message"))); What I want to be able to do is get the "ClassName::MethodName" bit without having to type it in each time.

        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