Problems writing to NT 4.0 registry - Help 
Author Message
 Problems writing to NT 4.0 registry - Help

Hello,

I use RegCreateKeyEx in ADVAPI32.DLL to set and get registry settings.
The SaveSetting and GetSetting functions in VB are not good enough, since
they do not let you control the full path.

Everything works fine under Windows 95, and appears to work fine under NT
4.0.  That is until you reboot.  After rebooting NT 4.0, the registry
changes are gone.  Now, I can start and end the program many times, and
the program can set and read the registry changes.  I can run regedt32 and
see the changes in the registry.

However, they disappear after a re-boot in NT 4.0.  I am using VB 4.0
32-bit.  Anyone have any suggestions or ideas?  Thank you in advance.

Following are samples of the API calls I make, (with error checking code
in between).  I got them from MSDN.

lReturn = RegCreateKeyEx(HKEY_CURRENT_USER, sKeyMain, 0&, lpClass,
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, Security, hWndApp,
lpdwDisposition)

lReturn = RegSetValueEx(hWndKey, sSubKey, 0&, REG_SZ, sStringValue,
Len(sStringValue))



Fri, 16 Jul 1999 03:00:00 GMT  
 Problems writing to NT 4.0 registry - Help

MASUSA-

I'm not completely sure about NT, but it could be an entry in an INI file.



Quote:
> Hello,

> I use RegCreateKeyEx in ADVAPI32.DLL to set and get registry settings.
> The SaveSetting and GetSetting functions in VB are not good enough, since
> they do not let you control the full path.

> Everything works fine under Windows 95, and appears to work fine under NT
> 4.0.  That is until you reboot.  After rebooting NT 4.0, the registry
> changes are gone.  Now, I can start and end the program many times, and
> the program can set and read the registry changes.  I can run regedt32
and
> see the changes in the registry.

> However, they disappear after a re-boot in NT 4.0.  I am using VB 4.0
> 32-bit.  Anyone have any suggestions or ideas?  Thank you in advance.

> Following are samples of the API calls I make, (with error checking code
> in between).  I got them from MSDN.

> lReturn = RegCreateKeyEx(HKEY_CURRENT_USER, sKeyMain, 0&, lpClass,
> REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, Security, hWndApp,
> lpdwDisposition)

> lReturn = RegSetValueEx(hWndKey, sSubKey, 0&, REG_SZ, sStringValue,
> Len(sStringValue))



Sat, 17 Jul 1999 03:00:00 GMT  
 Problems writing to NT 4.0 registry - Help

Looks like you might be making changes for the current user
(HKEY_CURRENT_USER) and not the default user(HKEY_???).
Another problem that may pop up under NT 4.0 is the permissions the logged
in user has, they may need poweruser or administrator privledges to make
changes the the default user registry settings.

Tim



Quote:
> MASUSA-

> I'm not completely sure about NT, but it could be an entry in an INI
file.



> > Hello,

> > I use RegCreateKeyEx in ADVAPI32.DLL to set and get registry settings.
> > The SaveSetting and GetSetting functions in VB are not good enough,
since
> > they do not let you control the full path.

> > Everything works fine under Windows 95, and appears to work fine under
NT
> > 4.0.  That is until you reboot.  After rebooting NT 4.0, the registry
> > changes are gone.  Now, I can start and end the program many times, and
> > the program can set and read the registry changes.  I can run regedt32
> and
> > see the changes in the registry.

> > However, they disappear after a re-boot in NT 4.0.  I am using VB 4.0
> > 32-bit.  Anyone have any suggestions or ideas?  Thank you in advance.

> > Following are samples of the API calls I make, (with error checking
code
> > in between).  I got them from MSDN.

> > lReturn = RegCreateKeyEx(HKEY_CURRENT_USER, sKeyMain, 0&, lpClass,
> > REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, Security, hWndApp,
> > lpdwDisposition)

> > lReturn = RegSetValueEx(hWndKey, sSubKey, 0&, REG_SZ, sStringValue,
> > Len(sStringValue))



Fri, 23 Jul 1999 03:00:00 GMT  
 Problems writing to NT 4.0 registry - Help

Check out the source code to reg4vb by VBPJ, I think it came from the
article "Hacking the Windows Registry"..



Quote:
> Looks like you might be making changes for the current user
> (HKEY_CURRENT_USER) and not the default user(HKEY_???).
> Another problem that may pop up under NT 4.0 is the permissions the
logged
> in user has, they may need poweruser or administrator privledges to make
> changes the the default user registry settings.

> Tim



> > MASUSA-

> > I'm not completely sure about NT, but it could be an entry in an INI
> file.



> > > Hello,

> > > I use RegCreateKeyEx in ADVAPI32.DLL to set and get registry
settings.
> > > The SaveSetting and GetSetting functions in VB are not good enough,
> since
> > > they do not let you control the full path.

> > > Everything works fine under Windows 95, and appears to work fine
under
> NT
> > > 4.0.  That is until you reboot.  After rebooting NT 4.0, the registry
> > > changes are gone.  Now, I can start and end the program many times,
and
> > > the program can set and read the registry changes.  I can run
regedt32
> > and
> > > see the changes in the registry.

> > > However, they disappear after a re-boot in NT 4.0.  I am using VB 4.0
> > > 32-bit.  Anyone have any suggestions or ideas?  Thank you in advance.

> > > Following are samples of the API calls I make, (with error checking
> code
> > > in between).  I got them from MSDN.

> > > lReturn = RegCreateKeyEx(HKEY_CURRENT_USER, sKeyMain, 0&, lpClass,
> > > REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, Security, hWndApp,
> > > lpdwDisposition)

> > > lReturn = RegSetValueEx(hWndKey, sSubKey, 0&, REG_SZ, sStringValue,
> > > Len(sStringValue))



Tue, 27 Jul 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. VB 4.0 16 bit application written on Windows 3.11 for Win NT 4.0

2. VB5 Systray, Registry Issues and NT 4.0 - Pleaes Help

3. Help ! Can't write to NT registry

4. VB 4.0 and NT 4.0 problems

5. what does vb 4.0 write in the system registry file

6. NT 3.51 -> NT 4.0 problem

7. Help : Remote OLE Automation Problem in 95 and NT 4.0

8. Help: Problem With Dragging in NT 4.0

9. Q: Registry Win95/NT 4.0

10. APPL.INI >> NT 4.0 Registry

11. VB and NT 4.0 registry "transience"

12. Help : Remote OLE Automation Problem in 95 and NT 4.0

 

 
Powered by phpBB® Forum Software