At runtime I obtain an instance of descendant of TObject (for example its name is TGoodForm).
The definition of TGoodForm is unknown at compile time (I know that it is TGoodForm from TObject::ClassName()).
The question: how to create new instance of TGoodForm ?
In another words, can I get address of constructor through reference to existing object at runtime?
(Assembler is permitted)
admdvv
0
Newbie Poster
Recommended Answers
Jump to PostAt runtime I obtain an instance of descendant of TObject (for example its name is TGoodForm).
The definition of TGoodForm is unknown at compile time (I know that it is TGoodForm from TObject::ClassName()).
The question: how to create new instance of TGoodForm ?
In another words, can I get address of …
Jump to PostMaybe I'm not understanding you correctly..
Generated: Thu May 12 16:17:59 2005
[[b][u]001[/u][/b]] for (int i = 0, n = form->ComponentCount; i < n; ++i) { [[b][u]002[/u][/b]] TComponent *comp = form->Components[i]; [[b][u]003[/u][/b]] if (comp->ClassInfo() == "TGoodForm") { [[b][u]004[/u][/b]] [b]TGoodForm *tf = new TGoodForm(); // ????[/b] [[b][u]005[/u][/b]] …
All 5 Replies
subtronic
1
Junior Poster
admdvv
0
Newbie Poster
admdvv
0
Newbie Poster
subtronic
1
Junior Poster
admdvv
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.