I want to create classes from the name of a type previously saved in database (QualifiedName). but when I called the function TRttiContext.FindType ('QualifiedName'), I found only a few classes
Note: All classes are public and all classes are in the same unit and AllClasses Inherits from TMyClassParent
Procedure TMyObjects.Load;
var s, typeName : string;
ctx : TRttiContext;
t: TRttiInstanceType;
tp: TRttiType;
o: TMyClassParent;
begin
ctx := TRttiContext.Create;
try
While not Table.Eof do begin
typeName := format('%s.%s',[FieldByName('UnitName').AsString,FieldByName('TypeName').AsString]);
if trim(typeName) <> '' then begin
tp := ctx.FindType(typeName);
///..here when I debug some Types exists ( tp <> nil ) and for others tp = nil...
t := tp as TRttiInstanceType;
if Assigned(t) then begin
o := t.MetaClassType.Create;
//...
///...
end;
///....
end;
//....
finally
ctx.free;
end;
Is there anyOne who can Help me please, I am using Delphi XE5 and Sorry for my English..