Can there be something like this?
Note for this code to work properly, the component you are trying to create must also be registered!
Quote from: Thaddy on April 17, 2017, 06:31:06 pmNote for this code to work properly, the component you are trying to create must also be registered!No, it doesn't. That is true for DFM/LFM streaming, but not when you are passing in the actual class type as an input parameter.
Uhh, no. You do not need class to be registered in this case. When you are using RTL serializing functions, then you need register them so it can find correct class type and create proper instance.
Thaddy, Remy is completely correct.
Can be use Code: Pascal [Select]lbl := clsType(getControl(TLabel, myForm)); insteadCode: Pascal [Select]lbl := TLabel(getControl(TLabel, myForm));?
Of course not. There is nothing linked in your program that is NOT registered. Remy will confirm that.
Are you dumb...
IF you compile a simple program with just a single form and a memo...You expect a treeview or a listview to magically appear when idiots like you or OP want that?
Of course not! The code needs to be linked in... Which means the class needs to be registered...
The real question is, why are you creating controls dynamically in this fashion (using metaclass types) to begin with?