[DUG] Creating an object at run time.
David O'Brien
Dave at iccs.co.nz
Mon Jul 16 11:03:20 NZST 2012
Amazing how you read TypeInfo and the it is written TypInfo...
-----Original Message-----
From: delphi-bounces at listserver.123.net.nz
[mailto:delphi-bounces at listserver.123.net.nz] On Behalf Of David O'Brien
Sent: Monday, 16 July 2012 11:01 a.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Creating an object at run time.
Found it :-)
-----Original Message-----
From: delphi-bounces at listserver.123.net.nz
[mailto:delphi-bounces at listserver.123.net.nz] On Behalf Of David O'Brien
Sent: Monday, 16 July 2012 10:50 a.m.
To: todd.martin.nz at gmail.com; NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Creating an object at run time.
The help says these functions are in the unit typeinfo. I don't have
this anywhere. I'm running D2009. Is this in a different unit now or am
I missing something?
-----Original Message-----
From: delphi-bounces at listserver.123.net.nz
[mailto:delphi-bounces at listserver.123.net.nz] On Behalf Of Todd Martin
Sent: Friday, 13 July 2012 4:27 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Creating an object at run time.
b := TComponentClass(FindClass('TButton')).Create(nil);
propinfo := GetPropInfo(b.classinfo,'left'); SetOrdProp(b,propinfo,100);
> I want to create an object at runtime given a string with the object
type. Is this possible or do I need to do a whole pile of if then
else's? There is a limited number of different objects that need to be
created. I then want to access the created objects properties by name
and assign methods.
>
> This is not for oleobjects, but VCL controls.
>
> i.e.
> b := CreateObject('TButton') ;
> b.GetField('left') := 100 ;
> ...
>
> Help on any of these would be appreciated.
>
> Cheers,
> Dave.
>
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz
> with Subject: unsubscribe
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at listserver.123.net.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at listserver.123.net.nz with
Subject: unsubscribe
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at listserver.123.net.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at listserver.123.net.nz with
Subject: unsubscribe
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at listserver.123.net.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at listserver.123.net.nz with
Subject: unsubscribe
More information about the Delphi
mailing list