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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how:Name function after API name??

how:Name function after API name??

Scheduled Pinned Locked Moved C / C++ / MFC
jsonquestion
4 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.
  • H Offline
    H Offline
    happycpp
    wrote on last edited by
    #1

    hi everyone.. I'm working on a project to make a dll that contains some functions...I want to name some functions the same name that some APIs do.. e.g. I want to make my own "FormatMessage" function in my dll...

    C 1 Reply Last reply
    0
    • H happycpp

      hi everyone.. I'm working on a project to make a dll that contains some functions...I want to name some functions the same name that some APIs do.. e.g. I want to make my own "FormatMessage" function in my dll...

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Put them in a namespace. It's still a terrible idea. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder

      H 1 Reply Last reply
      0
      • C Christian Graus

        Put them in a namespace. It's still a terrible idea. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder

        H Offline
        H Offline
        happycpp
        wrote on last edited by
        #3

        I actually don't know how to do that could you write a simple function using this way...

        C 1 Reply Last reply
        0
        • H happycpp

          I actually don't know how to do that could you write a simple function using this way...

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          namespace ThisIsAHorribleIdea { void MyAPIFunction() { } } Now you need to call it like this : ThisIsAHorribleIdea::MyhAPIFunction(); And if you don't know what a namespace is, you should buy a beginners book on C++ and read it before you go any further. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder

          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