jeffcoop_69
New Member
Hi-de-ho good neighbor:
I have a procedure that writes writes data to the registry. The procedure works great on Win 95 and 98 but on Win 2000 it returns an error code 5 - which translates to Access Denied; but I can go into the registry using regedit and edit the same key I'm trying to write to. Has anyone experienced this problem? I don't think it's anything with the user rights on the machine because I have administrator rights which should allow me access. I'm using the following function to write to the registry:
PROCEDURE RegSetValueExA EXTERNAL "advapi32" :
DEFINE INPUT PARAMETER hkey AS LONG.
DEFINE INPUT PARAMETER lpValueName AS CHARACTER.
DEFINE INPUT PARAMETER lpdwReserved AS LONG.
DEFINE INPUT PARAMETER lpdwType AS LONG.
DEFINE INPUT PARAMETER lpbData AS LONG.
DEFINE INPUT PARAMETER lpcbData AS LONG.
DEFINE RETURN PARAMETER lpresult AS LONG.
/****
Declare Function RegSetValueEx Lib "advapi32" Alias "RegSetValueExA" _
(ByVal hKey As Long, _
ByVal lpszValueName As String, _
ByVal dwReserved As Long, _
ByVal fdwType As Long, _
lpbData As Any, _
ByVal cbData As Long) _
As Long
LONG RegSetValueEx(
HKEY hKey, // handle to key
LPCTSTR lpValueName, // value name
DWORD Reserved, // reserved
DWORD dwType, // value type
CONST BYTE *lpData, // value data
DWORD cbData // size of value data
);
****/
END PROCEDURE.
TIA!
I have a procedure that writes writes data to the registry. The procedure works great on Win 95 and 98 but on Win 2000 it returns an error code 5 - which translates to Access Denied; but I can go into the registry using regedit and edit the same key I'm trying to write to. Has anyone experienced this problem? I don't think it's anything with the user rights on the machine because I have administrator rights which should allow me access. I'm using the following function to write to the registry:
PROCEDURE RegSetValueExA EXTERNAL "advapi32" :
DEFINE INPUT PARAMETER hkey AS LONG.
DEFINE INPUT PARAMETER lpValueName AS CHARACTER.
DEFINE INPUT PARAMETER lpdwReserved AS LONG.
DEFINE INPUT PARAMETER lpdwType AS LONG.
DEFINE INPUT PARAMETER lpbData AS LONG.
DEFINE INPUT PARAMETER lpcbData AS LONG.
DEFINE RETURN PARAMETER lpresult AS LONG.
/****
Declare Function RegSetValueEx Lib "advapi32" Alias "RegSetValueExA" _
(ByVal hKey As Long, _
ByVal lpszValueName As String, _
ByVal dwReserved As Long, _
ByVal fdwType As Long, _
lpbData As Any, _
ByVal cbData As Long) _
As Long
LONG RegSetValueEx(
HKEY hKey, // handle to key
LPCTSTR lpValueName, // value name
DWORD Reserved, // reserved
DWORD dwType, // value type
CONST BYTE *lpData, // value data
DWORD cbData // size of value data
);
****/
END PROCEDURE.
TIA!