Get a registry string....

Ok, here is the situation.... I want to get a string from the registry... the string is  -

HKEY_LOCAL_MACHINE\Software\Netscape\Netscape Navigator\CurrentVersion

Where CurrentVersion  is the string.  Now,  I've tried RegGetValue, GetRegKeyValue, and they both said "undeclared identifier"  :(

Can you please provide a working way to get the string of the location specified above.. I would really appreciate it.

I would offer more, but I dont have any more points.. :(

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

jkrConnect With a Mentor Commented:
Use the following code:

    HANDLE  hKey;
    char    acVersion [ MAX_VERSION];
    DWORD   dwType  =   REG_SZ;
    DWORD   dwSize  =   sizeof  (   acVersion);

    if  (   ERROR_SUCCESS   ==  RegOpenKeyEx    (    HKEY_LOCAL_MACHINE,
                                                     "Software\\Netscape\\Netscape Navigator",
          // error

    if  (   ERROR_SUCCESS   !=  RegQueryValueEx (   hKey,
                                                    ( PUCHAR) acVersion,
          // error

    RegCloseKey ( hKey);

Feel free to ask if you encounter problems!
Nitro187Author Commented:
Thanks a lot!  :)
All Courses

From novice to tech pro — start learning today.