Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jul 2001
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Edit registry (VB6)

    how do i specify the registry path in specific, if you look at the registry, most major programs have there own folder in the registry and then there settings within that folder. I would like to mimic this. I want my program to create its own folder and then the individual settings within that folder, right now my program puts all the stuff into HKEY_CURRENTUSERsoftwarevb and vba program settingsmy prgrams name..and then all the settings, O would like to put it in the same place but without the vb and vba program settings part. Please advise

    thanks

  2. #2
    2 Star Lounger
    Join Date
    Nov 2001
    Location
    London, UK, England
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Edit registry (VB6)

    The best way to manipulate registry settings to create your own specific software keys is to use a class object, which I have attached (I've had to be sneaky and change the extension to .TXT. Simply change it back to .CLS when you download it). You can reuse this in any projects you create and your software keys will all be located in the same place.

    If you look in the function 'TransferValueEx', you will see I have set the full key to...

    sFullKey = "SOFTWAREMYPROGRAM" & App.Title & "" & sKeyName

    If you change 'MYPROGRAM' to whatever you require, this is where all your registry settings will be stored. Here is a quick example on how to use the object to create a new string entry in the registry.

    Dim cReg As New Registry
    cReg.TransferValueEx REG_TRANSFER_WRITE, False, "Test", "Test", REG_SZ, "1", "1"

    Have a look at the class to see how the different parameters are used...
    Attached Files Attached Files

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Edit registry (VB6)

    That is the normal location for vb/vba based apps when you install them. There's usually a separate key for the named program under the HKEY_LOCAL_MACHINESoftware hive. You control the registry setting created through the paths you enter in the packaging wizard.
    Charlotte

  4. #4
    2 Star Lounger
    Join Date
    Jul 2001
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Edit registry (VB6)

    okay, I will try this out, another thing I have noticed is that when I uninstall the program using windows add/remove utility, the registry does not delete this folder, so if i install the program again it responds different. how can I make it go away after.

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Edit registry (VB6)

    You probably don't want the keys removed on a client machine, but if you want them removed on the development PC, just edit the registry and delete the keys for your program from both the CURRENT_USER and LOCAL_MACHINE hives. Very few programs are completely removed by uninstall.
    Charlotte

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Edit registry (VB6)

    Thanks for this. I have made use of it in a small utility whose birth is announced <!post=here,468072>here<!/post>

Posting Permissions

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