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. Visual Basic
  4. Reading binary registry key returns "nothing"

Reading binary registry key returns "nothing"

Scheduled Pinned Locked Moved Visual Basic
windows-adminquestion
4 Posts 2 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.
  • C Offline
    C Offline
    Chinners
    wrote on last edited by
    #1

    Hi, I am trying to read some system config from the registry. The config info is stored as a binary value of type "REG_RESOURCE_LIST". If I try read this value with o=registrykey.getvalue(), (with o being an object), o will be set to nothing. I can read a string key from the same group using the same command, and it works. It just always seems to fail on binary keys. The "GetValueKind" of this key type returns Unknown. Any idea what I am doing wrong? I've been googling for what seems like all morning, and I cant find a solution. [Modified to sort out a typo]

    L 1 Reply Last reply
    0
    • C Chinners

      Hi, I am trying to read some system config from the registry. The config info is stored as a binary value of type "REG_RESOURCE_LIST". If I try read this value with o=registrykey.getvalue(), (with o being an object), o will be set to nothing. I can read a string key from the same group using the same command, and it works. It just always seems to fail on binary keys. The "GetValueKind" of this key type returns Unknown. Any idea what I am doing wrong? I've been googling for what seems like all morning, and I cant find a solution. [Modified to sort out a typo]

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, the RegistryValueKind Enumeration lists all data kinds supported by .NET, as well as Unknown for all the other ones. So you're out of luck. I suggest you use P/Invoke and call the Win32 functions directly (as was needed for all kinds other than REG_SZ before .NET 2.0). :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      Voting for dummies? No thanks. X|


      C 1 Reply Last reply
      0
      • L Luc Pattyn

        Hi, the RegistryValueKind Enumeration lists all data kinds supported by .NET, as well as Unknown for all the other ones. So you're out of luck. I suggest you use P/Invoke and call the Win32 functions directly (as was needed for all kinds other than REG_SZ before .NET 2.0). :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        Voting for dummies? No thanks. X|


        C Offline
        C Offline
        Chinners
        wrote on last edited by
        #3

        I was hoping not to have to do that. Oh hum. Thanks for the reply - at least it puts my mind at rest that I have not gone crazy... (I am just slowly on my way to being there! :) ) Thanks.

        L 1 Reply Last reply
        0
        • C Chinners

          I was hoping not to have to do that. Oh hum. Thanks for the reply - at least it puts my mind at rest that I have not gone crazy... (I am just slowly on my way to being there! :) ) Thanks.

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          You're welcome.

          Jasey9 wrote:

          at least it puts my mind at rest that I have not gone crazy

          I did not imply that, nor the opposite. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          Voting for dummies? No thanks. X|


          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