ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 4
Anonymous
204 Views, 3 Replies

registry

I'm having trouble reading HKLM registry keys when logged into XP as a
limited user. I have the necessary security access to the key and
occasionally it works but generally it doesn't.

The same routine works fine when logged in as administrator or with limited
access on a W2000 machine.

Has anyone had experience of this problem.

Thanks

Nick
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

hi,

start regedit.
click with the right mouse button on tree you want to read or write.
in this dropdown menu there is a option, where you can free the
access to all users.

if this is done, your app can read and write to it's free'd values.
Message 3 of 4
Anonymous
in reply to: Anonymous

The problem stated below occurs in an AutoCAD ARX 2004 app when i'm reading
my current version key from HKLM and then writing it to my current version
key in HKCU when logged in as a limited user in XP only.

Extract of the code that shows this problem is:


DWORD dwCUBufLen;
HKEY hkCUKey;
char szScadRelCUser[_MAX_PATH];
::RegOpenKeyEx(HKEY_CURRENT_USER, (LPCTSTR) strSubKey, 0,
KEY_QUERY_VALUE, &hkCUKey);
if(::RegQueryValueEx(hkCUKey, "CurVer", NULL, NULL, (LPBYTE)
szScadRelCUser, &dwCUBufLen) != ERROR_SUCCESS)
{
::AfxMessageBox("error Current User");
ReportRegistryErrorMsg();
::RegCloseKey(hkCUKey);
}

RegQueryValueEx is the problem line returning error. The error it reports
states that function was successfully completed???

As anyone else had such problems with ARX2004 and XP.

Thanks

Nick



"Nick Conway" wrote in message
news:85DCF2BBA0BF8E4B7D2BA0485B0515E0@in.WebX.maYIadrTaRb...
> I'm having trouble reading HKLM registry keys when logged into XP as a
> limited user. I have the necessary security access to the key and
> occasionally it works but generally it doesn't.
>
> The same routine works fine when logged in as administrator or with
limited
> access on a W2000 machine.
>
> Has anyone had experience of this problem.
>
> Thanks
>
> Nick
>
>
Message 4 of 4
Anonymous
in reply to: Anonymous

> DWORD dwCUBufLen;
> HKEY hkCUKey;
> char szScadRelCUser[_MAX_PATH];
> ::RegOpenKeyEx(HKEY_CURRENT_USER, (LPCTSTR) strSubKey, 0,
> KEY_QUERY_VALUE, &hkCUKey);
> if(::RegQueryValueEx(hkCUKey, "CurVer", NULL, NULL, (LPBYTE)
> szScadRelCUser, &dwCUBufLen) != ERROR_SUCCESS)
> {
> ::AfxMessageBox("error Current User");
> ReportRegistryErrorMsg();
> ::RegCloseKey(hkCUKey);
> }

Have you tried KEY_READ instead of KEY_QUERY_VALUE?

Also, if you plan to write to it you should use KEY_READ|KEY_WRITE.

--
|
----+----------------------------------------------
| Byron Blattel
| CADwerx---Applications for AutoCAD
| Autodesk Registered Developer
| email: byron@cadwerx.net
| web site: http://www.cadwerx.net
|

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost