ON SHUTDOWN QUIT SYS(2340,1) * TESTING ONLY SET DEFAULT TO "c:\FMSDev\EMPS\" SET PROCEDURE TO EMPS_Registry ADDITIVE DO FORM "EMPS_ADMIN" READ EVENTS QUITThen the form's INIT (note the ERROR comment):
* TESTING ONLY * USE "c:\fmsrun\prompt\Ext_Prog.dbf" IN 0 * TESTING ONLY oRegistry = NEWOBJECT("Registry","EMPS_Registry.fxp") * ERROR is here, when the first constant, HKEY_LOCAL_MACHINE, is not found. Each constant defined in * the INCLUDE file after that is also not found. *** Now Read the values back THISFORM.HostName = oRegistry.ReadRegistryString(HKEY_LOCAL_MACHINE,; "SYSTEM\CurrentControlSet\Services\EMPS\Parameters",; "HostName") *** Now Read the values back THISFORM.Port = oRegistry.ReadRegistryString(HKEY_LOCAL_MACHINE,; "SYSTEM\CurrentControlSet\Services\EMPS\Parameters",; "Port") *** Now Read the values back THISFORM.BackupDirectory = oRegistry.ReadRegistryString(HKEY_LOCAL_MACHINE,; "SYSTEM\CurrentControlSet\Services\EMPS\Parameters",; "BackupDirectory") *** Now Read the values back THISFORM.Switch = oRegistry.ReadRegistryString(HKEY_LOCAL_MACHINE,; "SYSTEM\CurrentControlSet\Services\EMPS\Parameters",; "Switch") WITH THISFORM .txtHostName.CONTROLSOURCE = .HostName .txtPort.CONTROLSOURCE = .Port .txtDirectory.CONTROLSOURCE = .BackupDirectory .txtSwitch.CONTROLSOURCE = .Switch .VISIBLE = .T. ENDWITHAnd the INCLUDE file:
#DEFINE MAX_INI_BUFFERSIZE 256 #DEFINE MAX_INI_ENUM_BUFFERSIZE 16000 #DEFINE HKEY_CLASSES_ROOT -2147483648 #DEFINE HKEY_CURRENT_USER -2147483647 #DEFINE HKEY_LOCAL_MACHINE -2147483646 #DEFINE HKEY_USERS -2147483645 #DEFINE ERROR_SUCCESS 0 #DEFINE REG_NONE 0 #DEFINE REG_SZ 1 #DEFINE REG_BINARY 3 #DEFINE REG_DWORD 4 #DEFINE MULTI_SZ 7I'm not going to post the class definition code as it's a bit big and not really relevant for finding out why the constants are out of scope.