TReg32 problem

TReg32 problem

Postby Marc Vanzegbroeck » Tue Mar 03, 2009 10:09 pm

Hi,

When I used FW1.9.5 + clipper I used

Code: Select all  Expand view
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: Select all  Expand view
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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: TReg32 problem

Postby ukoenig » 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 :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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: TReg32 problem

Postby Marc Vanzegbroeck » 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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: TReg32 problem

Postby Marc Vanzegbroeck » Wed Mar 04, 2009 9: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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: TReg32 problem

Postby ukoenig » Wed Mar 04, 2009 9: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: TReg32 problem

Postby Marc Vanzegbroeck » 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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: TReg32 problem

Postby ukoenig » 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: Select all  Expand view

 
' 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 :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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: TReg32 problem

Postby Marc Vanzegbroeck » 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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 55 guests