Link to home
Start Free TrialLog in
Avatar of skin444
skin444

asked on

Accessing components dynamically

Hiya,

Is there a way in D2 to access an existing component on a form given a string that contains the name of the component?
I'm not clear that something like:
var
  cc: TPersistentClass ;
  c: TComponent;
begin
  cc := GetClass('Memo1');
  c := TComponentClass(cc).Create(application);

is appropriate because the Memo1 component was already created with the form create.  Is there a simple way.
A code snippet would be much appreciated.

Thanks,
Bob Skinner
rskinner@ix.netcom.com
component := TComponentClass(
ASKER CERTIFIED SOLUTION
Avatar of icampbe1
icampbe1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
For access dynamically component you can see the sample from
BORLAND in the folder DEMO of DELPHI 1.2 (16bits)
The name of the .DPR is DYNAINST.DPR