|
Create a data server using COM. Localize all your date there and share it among several processes. |
Step 1:![]()
|
Step 2:![]() ![]() |
Step 3: Open the unit for the Automation Object. It can be hard to find since Delphi doesn't open it automatically. In the sample the unit is called "uDataServ.pas"; it will be Unit1 by default. In this unit you should see your new Class with Get_Animal and Set_Animal in it. Modify them as follows:
function TDataSvr.Get_Animal(Index: Integer): WideString; |
Step 4: Test your new server Make a new form with a button like this:
procedure TForm1.Button1Click(Sender: TObject);
ShowMessage(R.Animal[1]); Provided everything has gone right, you should now see "cat". If you leave ActServ open and change the contents of the memo you can instantly see the results by pressing the button. |
Notes: This is a rather simple method. There is a more complicated method (based on this one) to follow. |