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 problems.

RegEnumValue problems.

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

    I wrote my code in VB(It is hell but i had not choice), but it does not work. I keeps returning error 234 (ERROR_MORE_DATA). But i have a 12 Kb buffer, which means the problems is something else. Please Help. I am already 3 hours in this &^&%&%.:mad::mad::mad:

    D N 2 Replies Last reply
    0
    • H HAHAHA_NEXT

      I wrote my code in VB(It is hell but i had not choice), but it does not work. I keeps returning error 234 (ERROR_MORE_DATA). But i have a 12 Kb buffer, which means the problems is something else. Please Help. I am already 3 hours in this &^&%&%.:mad::mad::mad:

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

      HAHAHA_NEXT wrote: I keeps returning error 234 (ERROR_MORE_DATA). But i have a 12 Kb buffer, which means the problems is something else. You failed to indicate what API you are using that is producing this "error." In any case, it's obvious that a 12KB buffer is insufficient. Try a larger number.


      "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

      1 Reply Last reply
      0
      • H HAHAHA_NEXT

        I wrote my code in VB(It is hell but i had not choice), but it does not work. I keeps returning error 234 (ERROR_MORE_DATA). But i have a 12 Kb buffer, which means the problems is something else. Please Help. I am already 3 hours in this &^&%&%.:mad::mad::mad:

        N Offline
        N Offline
        Navin
        wrote on last edited by
        #3

        ERROR_MORE_DATA is not really an error. It simply means that there are more values to enumerate. RegEnumValue does not enumerate *all* values, you give it a counter, and it enumerates one at a time. For instance (yes, this is C++ code, but you can figure out the algorithm):DWORD error; DWORD index = 0; TCHAR nameBuff[1024]; TCHAR valueBuff[1024]; DWORD nameBuffSize, valueBuffSize; DWORD type; do { nameBuffSize = valueBuffSize = 1024; error = ::RegEnumValue(hSectionKey, index, nameBuff, nameBuffSize, 0, &type,(BYTE *)valueBuff, &valueBuffSize); if(error == ERROR_SUCCESS || error == ERROR_MORE_DATA) { // do something with the enumerated value } index++; } while(error == ERROR_SUCCESS || ERROR == ERROR_MORE_DATA);
        Sometimes I feel like I'm a USB printer in a parallel universe.

        H 2 Replies Last reply
        0
        • N Navin

          ERROR_MORE_DATA is not really an error. It simply means that there are more values to enumerate. RegEnumValue does not enumerate *all* values, you give it a counter, and it enumerates one at a time. For instance (yes, this is C++ code, but you can figure out the algorithm):DWORD error; DWORD index = 0; TCHAR nameBuff[1024]; TCHAR valueBuff[1024]; DWORD nameBuffSize, valueBuffSize; DWORD type; do { nameBuffSize = valueBuffSize = 1024; error = ::RegEnumValue(hSectionKey, index, nameBuff, nameBuffSize, 0, &type,(BYTE *)valueBuff, &valueBuffSize); if(error == ERROR_SUCCESS || error == ERROR_MORE_DATA) { // do something with the enumerated value } index++; } while(error == ERROR_SUCCESS || ERROR == ERROR_MORE_DATA);
          Sometimes I feel like I'm a USB printer in a parallel universe.

          H Offline
          H Offline
          HAHAHA_NEXT
          wrote on last edited by
          #4

          I think i found it. Stupid vb does not understand NULLS.

          1 Reply Last reply
          0
          • N Navin

            ERROR_MORE_DATA is not really an error. It simply means that there are more values to enumerate. RegEnumValue does not enumerate *all* values, you give it a counter, and it enumerates one at a time. For instance (yes, this is C++ code, but you can figure out the algorithm):DWORD error; DWORD index = 0; TCHAR nameBuff[1024]; TCHAR valueBuff[1024]; DWORD nameBuffSize, valueBuffSize; DWORD type; do { nameBuffSize = valueBuffSize = 1024; error = ::RegEnumValue(hSectionKey, index, nameBuff, nameBuffSize, 0, &type,(BYTE *)valueBuff, &valueBuffSize); if(error == ERROR_SUCCESS || error == ERROR_MORE_DATA) { // do something with the enumerated value } index++; } while(error == ERROR_SUCCESS || ERROR == ERROR_MORE_DATA);
            Sometimes I feel like I'm a USB printer in a parallel universe.

            H Offline
            H Offline
            HAHAHA_NEXT
            wrote on last edited by
            #5

            I think i found it. Stupid vb does not understand NULLS. error = ::RegEnumValue(hSectionKey, index, nameBuff, nameBuffSize, 0, NULL,NULL,NULL); Does not work with VB (&^%$^^&^%&) :mad:. Thank you all. I changed my code and it works now.

            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