General information
Category:
Coding, syntax & commands
I've checked the code and added to the case structure of the init of registry of Windows 5.00 - you were right about this one it was always going to the otherwise statement. This is a sample code that works with win95/98 and creates the registry keys.
***********************************************************
* C R E A T E / R E A D R E G I S T R Y K E Y S
***********************************************************
SET PROCEDURE TO REGISTRY
oRegistry = CreateObject("Registry")
lKey = oRegistry.IsKey("Software\POSYSTEM",-2147483647)
* Master key does not exist so create it:
IF NOT lKey
DO FORM Init LINKED
* Create keys:
oRegistry.OpenKey("\Software\POSYSTEM",-2147483647,.T.)
oRegistry.OpenKey("\Software\POSYSTEM\ODBC",-2147483647,.T.)
* Create entries :
oRegistry.SetRegKey("Standard","Unknown","Software\POSYSTEM\ODBC",-2147483647)
oRegistry.SetRegKey("Backup","Unknown","Software\POSYSTEM\ODBC",-2147483647)
oRegistry.SetRegKey("LoginType","1","Software\POSYSTEM\ODBC",-2147483647)
oRegistry.SetRegKey("LoginName","","Software\POSYSTEM\ODBC",-2147483647)
oRegistry.SetRegKey("LoginPw","","Software\POSYSTEM\ODBC",-2147483647)
Init.Release
ENDIF
DO FORM Init2 LINKED
cSettings = REPLICATE(chr(0),20*160)
oRegistry.GetRegKey("Standard",@cSettings,"Software\POSYSTEM\ODBC",-2147483647)
aODBC[1] = ALLTRIM(cSettings)
cSettings = REPLICATE(chr(0),20*160)
oRegistry.GetRegKey("Backup",@cSettings,"Software\POSYSTEM\ODBC",-2147483647)
aODBC[2] = ALLTRIM(cSettings)
cSettings = REPLICATE(chr(0),20*160)
oRegistry.GetRegKey("LoginType",@cSettings,"Software\POSYSTEM\ODBC",-2147483647)
Thisform.nLoginType = VAL(ALLTRIM(cSettings))
cSettings = REPLICATE(chr(0),20*160)
oRegistry.GetRegKey("LoginName",@cSettings,"Software\POSYSTEM\ODBC",-2147483647)
Thisform.cUserName = ALLTRIM(cSettings)
cSettings = REPLICATE(chr(0),20*160)
oRegistry.GetRegKey("LoginPw",@cSettings,"Software\POSYSTEM\ODBC",-2147483647)
Thisform.cPassword = ALLTRIM(cSettings)
Init2.Release
SET PROCEDURE TO
RETURN
My question : Is the -2147483647 value a common value for registry entries and if not, how do I acquire this value ? This is passed to the registry.prg as a parameter in nRegKey in the majority of the functions.
Appreciate all the suggestions on this one. :-) !
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only