Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Re: Accessing registry through VB.Thanks send me the- dll please


Message #1 by "Sharma, Neeraj" <nsharma@A...> on Wed, 28 Mar 2001 11:09:29 -0800
-----Original Message-----
From: Yoel Pedersen [mailto:y.pedersen@g...]
Sent: Saturday, March 24, 2001 12:18 AM
To: professional vb
Subject: [pro_vb] Re: Accessing registry through VB

Hi Yoel

Thanks a lot for helping me with the problem.Could u mail me the concerned
Dll.

Thanks again
Neeraj



Hi Neeraj,

If you want to read a value from registry in VB there are three ways to do 
it:

1. Use the built-in functions SaveSetting() and GetSetting()
2. Use the Windows Registry API
3. Use the Reg.dll from Microsoft to access a registry object

The first option is very limited (you can't access all the registry, just 
a part of it).
The second is very difficult and includes a lot of code.
The third is easy to use. You just register the DLL and make a reference 
to it in the Project - References menu. Then you can make a new variable 
containing the registry class from which you can use the methods Get and 
Set to retrieve and set settings in registry:

Dim myRegistryObject As New CRegObj

MsgBox myRegistryObject.Get
("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Current Version\somekey")

...or so. E-mail me if you want to get the dll, and I'll send it to you.

Sincerely, Yoel Pedersen

> Hi all,
> I m working on a VB application in which I m supposed to read values 
from a
> key in the registry.Can anyone send me the code including step by step
> directions.
> Thanks
> Neeraj

  Return to Index