Re: Digest Number 2267

Louis Nardozi <[email protected]> Thu, 14 Aug 2003 21:03:16 -0500
Newsgroups gmane.comp.lang.delphi.programming
Message-ID <[email protected]>
Hi, Luke....

I'm sorry I can't be of any help, but your post has really gotten me 
curious. I've been out-of-town, so I'm kind of coming in in the middle 
here, I think. Why do you need a string with the object's classname in 
it? I'm not dissing you, I'm just curious. Why can't you just use 
.ClassName? Doesn't everything have it? Maybe even override ClassName to 
be read/write if you need it that way?

Regards,
Louis


>Message: 10
>   Date: Tue, 12 Aug 2003 13:40:23 -0000
>   From: "Luke Young" <[email protected]>
>Subject: Creating Objects using strings
>
>The problem:
>
>I want to create an object of a class that has its class name stored
>as a string.
>
>Currently I do this by using
>
>initialization
>  RegisterClass(TMyClassName);
>
>and then in the routine I use
>
>tmpClass := FindClass(strClass);
>tmpObject := TControlClass(tmpClass).Create(Self); { All classes are
>TControlClass based }
>
>Is there a better way of doing this? I am wondering if Registering the
>class has any penalty? or is this the way to go?
>
>Cheers
>
>Luke
>
>
>
>________________________________________________________________________
>________________________________________________________________________
>


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/i7folB/TM
---------------------------------------------------------------------~->

CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
--------------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/