Jump to content

Active form class name / caption / name


jaromir

Recommended Posts

I made this this way. But this is workaround.

I'm pretty sure that better way exists.

  TDMMain = class(TUniGUIMainModule)
  private
    { Private declarations }
    fLastFormInstanceClassName: String;
  public
    { Public declarations }
    function GetFormInstance(const InClass: TClass): TComponent;
  end;
  
function TDMMain.GetFormInstance(const InClass: TClass): TComponent;
begin
  fLastFormInstanceClassName := InClass.ClassName;
  Result := inherited GetFormInstance(InClass);
end;

  TDMServer = class(TUniGUIServerModule)
    procedure UniGUIServerModuleException(Sender: TUniGUIMainModule; AException: Exception;
      var Handled: Boolean);
  end;
  
procedure TDMServer.UniGUIServerModuleException(Sender: TUniGUIMainModule; AException: Exception;
  var Handled: Boolean);
begin
  SendEmailMessage(DMMain.LastFormInstanceClassName, AException.ClassName, AException.Message);
end;  

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...