Reading registry values in 95/98 compared to NT/2000 
Author Message
 Reading registry values in 95/98 compared to NT/2000

Greetings,

    I have run into the following problem.  I have developed an application
that queries a value in the registry, specifically:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MSDUN
\DisplayName

    The DisplayName value is set to:   "Dial-Up Networking Upgrade 1.3".  If
I run this program on NT or 2000 then it returns the correct value string.
However in 95 or 98 it returns a blank.  I conducted further testing and was
able to determine that it will work on 95 and 98 if the value is the
following "Dial-Up Networking U" which happens to be the first 20 characters
in the value string.  At the moment I make the value any bigger such as
"Dial-Up Networking Up" then it returns 'garbage'.  Can anyone think of a
reason why I appear to be limited on the number of characters allowed in a
value in order to return the value correctly?  Is there any way around this?

Thank you for your time,

    Ben



Fri, 27 Sep 2002 03:00:00 GMT  
 Reading registry values in 95/98 compared to NT/2000

Quote:

> Can anyone think of a reason why I appear to be limited on the
> number of characters allowed in a value in order to return the
> value correctly?

I expect you're doing something wrong. ;-) Is the return code
ERROR_MORE_DATA? Post your code so we can see what's going on.

Cheers,

- Jim



Sat, 28 Sep 2002 03:00:00 GMT  
 Reading registry values in 95/98 compared to NT/2000
Here is my code snippet.  hKeyDUN is desclared as an hKey.  szDUNKey is
declared as TCHAR szDUNKey[64].  dwBufLen is declared as DWORD dwBufLen =
64.  I hope you might be able to spot what is wrong.

   RegOpenKeyEx(HKEY_LOCAL_MACHINE,
TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSDUN"), 0,
KEY_QUERY_VALUE, &hKeyDUN);
   lRet = RegQueryValueEx(hKeyDUN, TEXT("DisplayName"), NULL, NULL,
(LPBYTE)szDUNKey, &dwBufLen);
   RegCloseKey(hKeyDUN);
   MessageBox(NULL, szDUNKey, "DUN Key", MB_OK);

If the value is more than 20 characters then the message box is blank in 95
and 98, but it displays fine in NT and 2000.

Thank you for your time,

    Ben


Quote:

> > Can anyone think of a reason why I appear to be limited on the
> > number of characters allowed in a value in order to return the
> > value correctly?

> I expect you're doing something wrong. ;-) Is the return code
> ERROR_MORE_DATA? Post your code so we can see what's going on.

> Cheers,

> - Jim



Sat, 28 Sep 2002 03:00:00 GMT  
 Reading registry values in 95/98 compared to NT/2000

Quote:

> Here is my code snippet.

The code looks OK. I ran it on Win98 and it works OK too. Are you sure
your real code matches the code you posted? Does dwBufLen definitely
contain the value 64 when you call RegQueryValueEx?

Cheers,

- Jim



Sun, 29 Sep 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Error reading registry values over 20 characters in 95/98

2. strcpy(x, x) works in NT/2000 but not 95/98

3. IPC windows 95/98/NT/2000

4. Registry: Differences between Win NT/95/98

5. CTreeCtrl TVN_ values differ in 95/98 and NT

6. Different mnemonics behaviour on 95/98 and 2000/XP

7. Application runs on 2000 but not on 98 or 95

8. Getting MAC Address in WIndows 98 and NT/2000/NT

9. Win NT 4.0 - Win 95 Registry Reading Problems

10. DBWin32 V2.2 Captures OutputDebugString on '95/'98/NT

11. DCOM with windows NT/ 95-98

12. Develope DB for clients computers running microsoft 95/98/NT

 

 
Powered by phpBB® Forum Software