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. how to generate uid for header files

how to generate uid for header files

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
6 Posts 5 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.
  • L Offline
    L Offline
    lakshman rao
    wrote on last edited by
    #1

    Hi, How to generate this type of number in header files? #if !defined(AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_) #define AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_

    C CPalliniC _ Y 4 Replies Last reply
    0
    • L lakshman rao

      Hi, How to generate this type of number in header files? #if !defined(AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_) #define AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      They are usually generated automatically when you create a new class through the MFC wizard. On the other hand, you can perfectly attribute one yourself, usually the filename is used in someone (e.g. MYFILE_H). As long as the identifier is unique, its perfectly fine. You can also use the #pragma once directive which has been added in more recent compiler versions.

      Cédric Moonen Software developer
      Charting control [v3.0] OpenGL game tutorial in C++

      1 Reply Last reply
      0
      • L lakshman rao

        Hi, How to generate this type of number in header files? #if !defined(AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_) #define AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        To get new GUIDs you've to use guidgen tool, see here[^] for the steps required to run the tool from the Visual Studio IDE. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        In testa che avete, signor di Ceprano?

        1 Reply Last reply
        0
        • L lakshman rao

          Hi, How to generate this type of number in header files? #if !defined(AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_) #define AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_

          _ Offline
          _ Offline
          _Superman_
          wrote on last edited by
          #4

          The other replies must be good enough for you. Nevertheless, you can do this programmatically using APIs like UuidCreate, UuidCreateSequential etc.

          «_Superman_»
          I love work. It gives me something to do between weekends.

          Microsoft MVP (Visual C++)

          Polymorphism in C

          L 1 Reply Last reply
          0
          • L lakshman rao

            Hi, How to generate this type of number in header files? #if !defined(AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_) #define AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_

            Y Offline
            Y Offline
            yu jian
            wrote on last edited by
            #5

            But my visual studio do not output uid insteaded by "#pragma once" :-D

            1 Reply Last reply
            0
            • _ _Superman_

              The other replies must be good enough for you. Nevertheless, you can do this programmatically using APIs like UuidCreate, UuidCreateSequential etc.

              «_Superman_»
              I love work. It gives me something to do between weekends.

              Microsoft MVP (Visual C++)

              Polymorphism in C

              L Offline
              L Offline
              lakshman rao
              wrote on last edited by
              #6

              Thank you! I thought there might be a way to generate the uid along with the header creation. In the above all replies we've to get uid separately and then append it to the header macro separately....

              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