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. add file version to a new text file

add file version to a new text file

Scheduled Pinned Locked Moved C / C++ / MFC
questionannouncement
13 Posts 4 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 henryh

    Hi All, I can see that exe files have file info including company name, version, ... How do I add the same information to a text file? Thanks, Henry

    henryh

    L Offline
    L Offline
    Lost User
    wrote on last edited by
    #4

    Hi, You could implement a property set handler. Check out the IPropertySetStorage interface[^]. Hope you have experience with COM. :-\ Property System Overview[^] Property System Code Samples[^] EnumAll Sample[^] Best Wishes, -David Delaune

    1 Reply Last reply
    0
    • D den2k88

      No way except writing that in the file itself. That informations are put in specific fields of the file with a well defined format that Windows understand and show you as field in its Property Dialog.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #5

      Not true, this information is held in the version record in the file's resources.

      1 Reply Last reply
      0
      • H henryh

        Hi All, I can see that exe files have file info including company name, version, ... How do I add the same information to a text file? Thanks, Henry

        henryh

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #6

        You can do this by creating an alternate stream on the file. See http://msdn.microsoft.com/en-us/library/windows/desktop/aa364404(v=vs.85).aspx[^].

        L 1 Reply Last reply
        0
        • D den2k88

          No way except writing that in the file itself. That informations are put in specific fields of the file with a well defined format that Windows understand and show you as field in its Property Dialog.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #7

          See also http://msdn.microsoft.com/en-us/library/windows/desktop/aa364404(v=vs.85).aspx[^].

          H 1 Reply Last reply
          0
          • L Lost User

            You can do this by creating an alternate stream on the file. See http://msdn.microsoft.com/en-us/library/windows/desktop/aa364404(v=vs.85).aspx[^].

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #8

            Hi, Fairly certain that he is referring to the 'File Property' dialog box displayed by explorer. Best Wishes, -David Delaune

            L 1 Reply Last reply
            0
            • L Lost User

              Hi, Fairly certain that he is referring to the 'File Property' dialog box displayed by explorer. Best Wishes, -David Delaune

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #9

              I agree, but streams do offer a potential solution, depending on what the 'real' requirements are. BTW, haven't seen you about recently; trust you are OK.

              H 1 Reply Last reply
              0
              • L Lost User

                I agree, but streams do offer a potential solution, depending on what the 'real' requirements are. BTW, haven't seen you about recently; trust you are OK.

                H Offline
                H Offline
                henryh
                wrote on last edited by
                #10

                Hi Guys, Thanks for the information. The information I want to attach to a file are details as in the following: File description: Type: File version: Product name: ... As I have a hex record file (text format), I want to know what File version so I can decide to use it or not, says for programming a device. I can use FileVersionInfo to read these info, but I don't know to set them to a text file. I guess the text file does not have these properties. Thanks, Henry

                henryh

                L 1 Reply Last reply
                0
                • L Lost User

                  See also http://msdn.microsoft.com/en-us/library/windows/desktop/aa364404(v=vs.85).aspx[^].

                  H Offline
                  H Offline
                  henryh
                  wrote on last edited by
                  #11

                  I check the link and it mainly deals with file attributes. Thanks, Henry

                  henryh

                  1 Reply Last reply
                  0
                  • H henryh

                    Hi Guys, Thanks for the information. The information I want to attach to a file are details as in the following: File description: Type: File version: Product name: ... As I have a hex record file (text format), I want to know what File version so I can decide to use it or not, says for programming a device. I can use FileVersionInfo to read these info, but I don't know to set them to a text file. I guess the text file does not have these properties. Thanks, Henry

                    henryh

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #12

                    If the file content is hex records (whatever that means) then it is not text. Why not just add the information as a header record at the beginning of the file?

                    1 Reply Last reply
                    0
                    • H henryh

                      Hi All, I can see that exe files have file info including company name, version, ... How do I add the same information to a text file? Thanks, Henry

                      henryh

                      D Offline
                      D Offline
                      David Crow
                      wrote on last edited by
                      #13

                      To my knowledge, text files do not meta data, which is where you would store things like company name, author, version, etc. For text files, the file system keeps track of simple things like date, time, and attributes.

                      "One man's wage rise is another man's price increase." - Harold Wilson

                      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                      "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

                      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