CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Binary Registry

  1. #1

    Binary Registry

    How do I store a binary value that I can store in the registry using a REG_BINARY value.
    I tried using a variable of type Byte, but I tried adding a value to it and slapping it into the registry but it didn't like it. Can you give me an example of doing this?


  2. #2
    Join Date
    Jun 2001
    Location
    Memphis, TN
    Posts
    146

    Re: Binary Registry

    To write binary data to the registry, try using the Wscript.Shell object for registry access.


    'declare this in a module or somethin
    Const REG_BINARY = 3

    'here is the code to create the Shell object
    Dim shell
    set shell = CreateObject("wscript.shell") 'oh the magic of Windows Script objects

    'this is the method to write to the registry
    'the '3' in the code is the binary data i'm sending to the key
    'and the REG_BINARY flag is what denotes the use
    'of binary storage
    shell.RegWrite "HKEY_CURRENT_USER\Software\MyTestKey\", 3, "REG_BINARY"




    Hope that makes sense!


  3. #3
    Join Date
    Apr 2000
    Posts
    737

    Re: Binary Registry

    you can try to look at the code for the activeX DLL in http://vblib.virtualave.net, if you pass it byte array, it will be REG_BINARY.



    HTH

    cksiow
    http://vblib.virtualave.net - share our codes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured