title: Delphi GetClass
body: <p>My question is how to access a class which is in an other unit? For an example:</p>
  
  <pre><code>program Project1;
  
  {$APPTYPE CONSOLE}
  
  uses
    SysUtils,
    Classes,
    System,
    StrUtils,
    Math,
    TypInfo,
    Data in 'Data.pas';
  
  var
    Str, name, value                      : string;
    List, tmpList                         : TStringList;
    i                                     : Integer;
    Obj                                   : TObject;
    CRef                                  : TPersistentClass;
    d                                     : TData;
  begin
    d := TData(GetClass('Data.TData').Create);
    Writeln(Format('%s', [d.Name]));
    Readln;
    Readln;
  end.
  </code></pre>
  
  <p>And the Data unit : </p>
  
  <pre><code>unit Data;
  
  interface
   uses
    SysUtils,
    Classes;
  type
    TData = class(TObject)
      FName : string;
    published
      property Name : string read FName write FName;
    end;
  type
    TIn = class(TObject)
      FName : string;
    published
      property Name : string read FName write FName;
    end;
  implementation
  
  end.
  </code></pre>
  
  <p>The problem is that the method GetClass return me always nil.
  I know that there is a questions like this one but they doesn't helped me.</p>
  
  <p>Thanks in advance!</p>