If anyone's interested,
There were two problems and they weren't easy to find while switching
between accounts and trying to debug code. Opening a key in HKLM, as
implemented in my class using KEY_ALL_ACCESS, will fail when the app is
installed by the admin the called by a non-admin account. Solved this by
adding a GetAccessRights() method which finds the access allowed by the
user. All other registry interaction except the product key was placed in
HKCU. Everything seems to be humming along for now.
Regards,
M
"Dave Patrick" <(E-Mail Removed)> wrote in message
news:6AF05DB2-9C33-4DBF-88D4-(E-Mail Removed)...
> You're welcome.
>
> --
>
> Regards,
>
> Dave Patrick ....Please no email replies - reply in newsgroup.
> Microsoft Certified Professional
> Microsoft MVP [Windows]
> http://www.microsoft.com/protect
>
> "Micus" wrote:
> > Thanks for both of your responses. You've given me a starting point to
> > finding a solution. I've posted a similar question in the vc.language
news
> > group and the response pointed to using HKEY_CURRENT_USER as well. I
wish
> > there was a 'HKEY_CURRENT_USER\Everyone\Software' key...
> >
> > Thanks again - Micus
> >
> >
> > "Micus" <no@way> wrote in message
> > news:(E-Mail Removed)...
> >> Hi All,
> >>
> >> I've created a software package. I can install it (for everyone) in
> > the
> >> administrator account and it works great. I then switch to another
> >> non-administrator account and open the application but the program
fails
> > to
> >> read any values in the registry. I'm storing the value in the
> >> HKEY_LOCAL_MACHINE\SOFTWARE. Can all users access this registry key? If
> > not,
> >> what root key should I put these values in? This is happening on a Win
XP
> >> machine, although I will need to have it install on a 2000 machine as
> > well.
> >>
> >> For those who are c++ Win32 savvy, here is the function:
> >>
> >> double CRegistry::ReadString(cString strName, double fDefault)
> >> {
> >> HKEY m_hRootKey = HKEY_LOCAL_MACHINE;
> >> cString m_strCurrentPath = "Software\\MyApp\\Settings";
> >> HKEY hKey;
> >> DWORD dwType = REG_SZ;
> >>
> >> if (::RegOpenKeyEx(m_hRootKey, LPCTSTR(m_strCurrentPath.c_str()), 0,
> >> KEY_READ, &hKey) != ERROR_SUCCESS) return fDefault;
> >>
> >> if (::RegQueryValueEx(hKey, LPCTSTR(strName.c_str()), NULL,
> >> &dwType, (LPBYTE)&d, &dwSize) != ERROR_SUCCESS) d = fDefault;
> >>
> >> return fDefault;
> >> }
> >>
> >> Thank you - Micus
> >>
> >>
> >>
> >
> >
>