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. RegEnumValue : Not able to retreive registry value for Date format..

RegEnumValue : Not able to retreive registry value for Date format..

Scheduled Pinned Locked Moved C / C++ / MFC
windows-adminquestion
9 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
    Supriya Tonape
    wrote on last edited by
    #1

    Hi, Can anybody tell me why am I not getting Value's data in below code, in buffer 'pszRegValData' ? The surprising thing is that I am able to receive other value's data in it which has REG_SZ datatype... but the value for which it's not giving any output has REG_SZ as a datatype too.. data for it is "04/26/2007 10:20:01".. It's not giving me data in buffer(pszRegValData) for REG_BINARY too... retCode = RegEnumValue(hkScanKey, i, szRegValueName, &dwRegValNameLen, NULL, &dwRegValType, (LPBYTE)pszRegValData, &dwRegValLen); Thanks in advance. regards, Supriya Tonape

    S 1 Reply Last reply
    0
    • S Supriya Tonape

      Hi, Can anybody tell me why am I not getting Value's data in below code, in buffer 'pszRegValData' ? The surprising thing is that I am able to receive other value's data in it which has REG_SZ datatype... but the value for which it's not giving any output has REG_SZ as a datatype too.. data for it is "04/26/2007 10:20:01".. It's not giving me data in buffer(pszRegValData) for REG_BINARY too... retCode = RegEnumValue(hkScanKey, i, szRegValueName, &dwRegValNameLen, NULL, &dwRegValType, (LPBYTE)pszRegValData, &dwRegValLen); Thanks in advance. regards, Supriya Tonape

      S Offline
      S Offline
      Supriya Tonape
      wrote on last edited by
      #2

      also the error code I get is '234' though I am making sure that buffer has enough size to hold the returned data...

      D 1 Reply Last reply
      0
      • S Supriya Tonape

        also the error code I get is '234' though I am making sure that buffer has enough size to hold the returned data...

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

        Supriya Tonape wrote:

        also the error code I get is '234'...

        Which is not an error, but means that more data is available.

        "Love people and use things, not love things and use people." - Unknown

        "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

        S 1 Reply Last reply
        0
        • D David Crow

          Supriya Tonape wrote:

          also the error code I get is '234'...

          Which is not an error, but means that more data is available.

          "Love people and use things, not love things and use people." - Unknown

          "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

          S Offline
          S Offline
          Supriya Tonape
          wrote on last edited by
          #4

          thanks for the reply. But I am already making sure that buffer size is enough to store the data...by API 'RegQueryInfoKey()' I am getting max length of value's data.. I am executing it before 'RegEnumValue()' and allocating the buffer for value (length returned by 'RegQueryInfoKey' + 1)... still why 234 error ? :(

          D S 2 Replies Last reply
          0
          • S Supriya Tonape

            thanks for the reply. But I am already making sure that buffer size is enough to store the data...by API 'RegQueryInfoKey()' I am getting max length of value's data.. I am executing it before 'RegEnumValue()' and allocating the buffer for value (length returned by 'RegQueryInfoKey' + 1)... still why 234 error ? :(

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

            Supriya Tonape wrote:

            ...still why 234 error ? :(

            It's not an error, but means that more data is available.

            "Love people and use things, not love things and use people." - Unknown

            "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

            1 Reply Last reply
            0
            • S Supriya Tonape

              thanks for the reply. But I am already making sure that buffer size is enough to store the data...by API 'RegQueryInfoKey()' I am getting max length of value's data.. I am executing it before 'RegEnumValue()' and allocating the buffer for value (length returned by 'RegQueryInfoKey' + 1)... still why 234 error ? :(

              S Offline
              S Offline
              Supriya Tonape
              wrote on last edited by
              #6

              I just traced my code and found that for every character it's taking 2 bytes.. and I am allocatiing buffer as per length returned by 'RegQueryInfoKey' which returned length of longest value data... for example actual date string/data(REG_SZ) length is 20 but when 'RegEnumValue' gets the date string/data, the length returned is 40(in last param of 'RegEnumValue').... So I doubled my buffer's size but still it gives me same problem... any suggestions ? I am running my 'console' appln on 32 bit intel proc with 32-bit XP OS on it...

              S 1 Reply Last reply
              0
              • S Supriya Tonape

                I just traced my code and found that for every character it's taking 2 bytes.. and I am allocatiing buffer as per length returned by 'RegQueryInfoKey' which returned length of longest value data... for example actual date string/data(REG_SZ) length is 20 but when 'RegEnumValue' gets the date string/data, the length returned is 40(in last param of 'RegEnumValue').... So I doubled my buffer's size but still it gives me same problem... any suggestions ? I am running my 'console' appln on 32 bit intel proc with 32-bit XP OS on it...

                S Offline
                S Offline
                Supriya Tonape
                wrote on last edited by
                #7

                awaiting for reply..

                S 1 Reply Last reply
                0
                • S Supriya Tonape

                  awaiting for reply..

                  S Offline
                  S Offline
                  Supriya Tonape
                  wrote on last edited by
                  #8

                  I resolved the prob, after each call we need to set the data buffer size back to max value length... sadly this is not quoted in MSDN! it's hard to understand whats going on wrong in code when MSDN says everytime 'RegEnumValue' iterates thru reg values,it returns the data length... I wasted my night for this silly problem...

                  S 1 Reply Last reply
                  0
                  • S Supriya Tonape

                    I resolved the prob, after each call we need to set the data buffer size back to max value length... sadly this is not quoted in MSDN! it's hard to understand whats going on wrong in code when MSDN says everytime 'RegEnumValue' iterates thru reg values,it returns the data length... I wasted my night for this silly problem...

                    S Offline
                    S Offline
                    smags13
                    wrote on last edited by
                    #9

                    ... I will try that. But I have alread wasted a whole weekend until I see your post ...

                    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