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. RegQueryValueEx returns value 6

RegQueryValueEx returns value 6

Scheduled Pinned Locked Moved C / C++ / MFC
help
6 Posts 4 Posters 1 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.
  • B Offline
    B Offline
    B0606115
    wrote on last edited by
    #1

    I have to read value of the registery so i am using RegQueryValueEx(),but it is returning value 6 which i have seen on msdn means : ERROR_INVALID_HANDLE 6 (0x6) The handle is invalid. so what should i do to remove this error. thanx in advance.

    R N CPalliniC 3 Replies Last reply
    0
    • B B0606115

      I have to read value of the registery so i am using RegQueryValueEx(),but it is returning value 6 which i have seen on msdn means : ERROR_INVALID_HANDLE 6 (0x6) The handle is invalid. so what should i do to remove this error. thanx in advance.

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      Well, what would you expect? Just provide it with a valid handle. FYI - the doc page[^] contains an example as well.

      It is a crappy thing, but it's life -^ Carlo Pallini

      1 Reply Last reply
      0
      • B B0606115

        I have to read value of the registery so i am using RegQueryValueEx(),but it is returning value 6 which i have seen on msdn means : ERROR_INVALID_HANDLE 6 (0x6) The handle is invalid. so what should i do to remove this error. thanx in advance.

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

        B0606115 wrote:

        so what should i do to remove this error.

        I guess... pass a valid handle...? Can you show how you called RegQueryValueEx?

        nave [OpenedFileFinder] [My Blog]

        B 1 Reply Last reply
        0
        • B B0606115

          I have to read value of the registery so i am using RegQueryValueEx(),but it is returning value 6 which i have seen on msdn means : ERROR_INVALID_HANDLE 6 (0x6) The handle is invalid. so what should i do to remove this error. thanx in advance.

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

          B0606115 wrote:

          so what should i do to remove this error.

          You may also choose to shut down the computer and go walking, if there is a sunny day (here is). (or you may give us more info...) :)

          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
          • N Naveen

            B0606115 wrote:

            so what should i do to remove this error.

            I guess... pass a valid handle...? Can you show how you called RegQueryValueEx?

            nave [OpenedFileFinder] [My Blog]

            B Offline
            B Offline
            B0606115
            wrote on last edited by
            #5

            HKEY hKey = GetRegistryKey(CString ("Connections") ); this has been successful as i have called RegEnumValue and thats working fine. but problem is with RegQueryValueEx int t= RegQueryValueEx( hKey, strValue, NULL, &Type,(LPBYTE)rgValue,&size1);

            CPalliniC 1 Reply Last reply
            0
            • B B0606115

              HKEY hKey = GetRegistryKey(CString ("Connections") ); this has been successful as i have called RegEnumValue and thats working fine. but problem is with RegQueryValueEx int t= RegQueryValueEx( hKey, strValue, NULL, &Type,(LPBYTE)rgValue,&size1);

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

              Documentation [^] states:

              hKey [in] A handle to an open registry key. The key must have been opened with the KEY_QUERY_VALUE access right. For more information, see Registry Key Security and Access Rights. This handle is returned by the RegCreateKeyEx, RegCreateKeyTransacted, RegOpenKeyEx, or RegOpenKeyTransacted function. It can also be one of the following predefined keys:[...]

              :)

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