nrComm1->LoadConfig( ? , ? , ? );

Started by To, March 14, 2012, 10:58:08 AM

Previous topic - Next topic

To

Hello,

I can not figure out what to put in a parameter to the following statement:
nrComm1->LoadConfig(

Could you help me?

Roman Novgorodov

Hello

This method loads serial port settings from system registry.

It has following declaration:
procedure LoadConfig(const Root:HKEY;const Key,Name:string);virtual;
  where Root handle of root key (f.e.  HKEY_LOCAL_MACHINE)
  Key path to key (fe 'Software\MyApp')
  Name name of binary value for keep serial port settings (fe 'rs232')

Roman Novgorodov
DeepSoftware LLC
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

To

Hello,
Thank for your answer.

I try it but it's not OK.

I try :       nrComm1->SaveConfig(HKEY_LOCAL_MACHINE,"c:\application\exe\","RS232");

And a error is : Le projet Project.exe a déclenché la classe d'exception ERegistryException avec le message 'Failed to set data for ' □□2".

Could you help me?

cptang

Quote from: To on March 14, 2012, 10:58:08 AM
Hello,

I can not figure out what to put in a parameter to the following statement:
nrComm1->LoadConfig(

Could you help me?

save:
nrComm1->SaveConfig(HKEY_LOCAL_MACHINE,"SOFTWARE\\System\\Windows","rs232")    ;
load:
nrComm1->LoadConfig(HKEY_LOCAL_MACHINE,"SOFTWARE\\System\\Windows","rs232")    ;

abak

Hi,

Here is my expertise :

1. nrComm1  must be Activate
2. Your Application should have "Require Administrator" on :  Project > Options > Manifest
3. Today use HKEY_CURRENT_USER   instead of HKEY_LOCAL_MACHINE  (windows 11 constraints).

  nrComm1.SaveConfig(HKEY_CURRENT_USER, 'Software\MyApp', 'rs232');
  nrComm1.LoadConfig(HKEY_CURRENT_USER, 'Software\MyApp', 'rs232');