FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TReg32 problem
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
TReg32 problem
Posted: Tue Mar 03, 2009 10:09 PM
Hi,

When I used FW1.9.5 + clipper I used

Code (fw): Select all Collapse
oReg2 := TReg32():Create(HKEY_LOCAL_MACHINE,"SOFTWARE\classes\clsid\{6B455450-5344-4F43-4879-653132303137}\AppID")
oReg2:Set('AppID','test')


But now in FWH it does't work anymore.
I only can read the key.

If I use
Code (fw): Select all Collapse
oReg := TReg32():Create( HKEY_LOCAL_MACHINE, "SOFTWARE\FiveWin\Reg32 Class Test" )

There is no problem...


What can be the problem?

Regards,
Marc
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: TReg32 problem
Posted: Tue Mar 03, 2009 10:32 PM
Hello Marc,

there is a sample in directory : FWH\samples\testrg32.prg

did You have a look at it ?

Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: TReg32 problem
Posted: Tue Mar 03, 2009 10:51 PM
Uwe,

In the sample testrg32.prg I have change the line key
SOFTWARE\FiveWin\Reg32 Class Test
to
SOFTWARE\classes\clsid\{6B455450-5344-4F43-4879-653132303137}\AppID"
and it doesn't work there also.

I use the lines already a longtime in my clipper programs without any problem, but now I found out that I can not write to that key anymore, only read...

Regards,
Marc
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: TReg32 problem
Posted: Wed Mar 04, 2009 09:38 AM

Hi,

It seems to be a Vista-problem. If I run it on a XP-PC there is no problem with the FWH-version.

Regards,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: TReg32 problem
Posted: Wed Mar 04, 2009 09:58 AM

Marc,

I work with Vista as well and tested it.
After running Testrg32.prg and checking with Regedit, there was no entry with values.

Regards
Uwe :lol:

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: TReg32 problem
Posted: Wed Mar 04, 2009 10:15 AM

Uwe,

It seems that I have to find another place then SOFTWARE\classes\clsid\ to store some variable in the register on Vista-PC's..
I used these path to make it difficult to customers to find it, because I store some copy-protections at places like this...

Regards,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: TReg32 problem
Posted: Wed Mar 04, 2009 11:22 AM
Hello Marc,

I had a look at the VB-Forum and got the following informations :
( maybe a change in Registry.prg necessary ? )

These functions are included in Registry.prg for Lib "advapi32.dll"

FUNCTION RegOpenKeyEx
FUNCTION RegQueryValueEx
FUNCTION RegCloseKey
FUNCTION RegEnumKeyEx
FUNCTION RegSetValueEx

Visual Basic :
Code (fw): Select all Collapse
 
' Registry-Key
Public Const HKEY_CLASSES_ROOT = &H80000000
Public Const HKEY_CURRENT_USER = &H80000001
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const HKEY_USERS = &H80000003
Public Const HKEY_PERFORMANCE_DATA = &H80000004
Public Const HKEY_CURRENT_CONFIG = &H80000005
Public Const HKEY_DYN_DATA = &H80000006
 
' Returns
Public Const REG_SZ = 1
Public Const REG_BINARY = 3
Public Const REG_DWORD = 4
Public Const ERROR_SUCCESS = 0&
 
// API-Defines
// ------------------
Public Declare Function RegOpenKey Lib "advapi32.dll" _
  Alias "RegOpenKeyA" ( _
  ByVal hKey As Long, _
  ByVal lpSubKey As String, _
  phkResult As Long) As Long
 
Public Declare Function RegCloseKey Lib "advapi32.dll" ( _
  ByVal hKey As Long) As Long
 
Public Declare Function RegCreateKey Lib "advapi32.dll" _
  Alias "RegCreateKeyA" ( _
  ByVal hKey As Long, _
  ByVal lpSubKey As String, _
  phkResult As Long) As Long
 
Public Declare Function RegDeleteKey Lib "advapi32.dll" _
  Alias "RegDeleteKeyA" ( _
  ByVal hKey As Long, _
  ByVal lpSubKey As String) As Long
 
Public Declare Function RegDeleteValue Lib "advapi32.dll" _
  Alias "RegDeleteValueA" ( _
  ByVal hKey As Long, _
  ByVal lpValueName As String) As Long
 
Public Declare Function RegEnumKey Lib "advapi32.dll" _
  Alias "RegEnumKeyA" ( _
  ByVal hKey As Long, _
  ByVal dwIndex As Long, _
  ByVal lpName As String, _
  ByVal cbName As Long) As Long
 
Public Declare Function RegEnumValue Lib "advapi32.dll" _
  Alias "RegEnumValueA" ( _
  ByVal hKey As Long, _
  ByVal dwIndex As Long, _
  ByVal lpValueName As String, _
  lpcbValueName As Long, _
  lpReserved As Long, _
  lpType As Long, _
  lpData As Byte, _
  lpcbData As Long) As Long
 
Public Declare Function RegQueryValueEx Lib "advapi32.dll" _
  Alias "RegQueryValueExA" ( _
  ByVal hKey As Long, _
  ByVal lpValueName As String, _
  ByVal lpReserved As Long, _
  lpType As Long, _
  lpData As Any, _
  lpcbData As Long) As Long
 
Public Declare Function RegSetValueEx Lib "advapi32.dll" _
  Alias "RegSetValueExA" ( _
  ByVal hKey As Long, _
  ByVal lpValueName As String, _
  ByVal Reserved As Long, _
  ByVal dwType As Long, _
  lpData As Any, _
  ByVal cbData As Long) As Long


Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: TReg32 problem
Posted: Wed Mar 04, 2009 12:07 PM

Uwe,

I think reg32.prg is already using these functions. I think the problem is in the security of vista because writing to other keys is working fine, only writing to SOFTWARE\classes\clsid\ have some problems.

Regards,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite

Continue the discussion