11-23-2024, 12:04 PM
(10-14-2020, 04:47 PM)kudzu Wrote: Doing so on new session is not a good idea. SetAsMainForm is a global setting and OnNewSession is threaded. This approach will create issues and could even cause crashes.
If you want to control which form is displayed dynamically use this event on the SC instead and create an instance of the form itself and return it in the var argument:
procedure TIWServerController.IWServerControllerBaseGetMainForm(var vMainForm: TIWBaseForm);
begin
end;
I'm trying to use IWServerControllerBaseGetMainForm(var vMainForm: TIWBaseForm)
Inside, I simply call:
WebApplication.ShowForm(TfrmDefault, TRUE, TRUE);
and it works. But I must be misusing it, i.e.: what about the “var vMainForm: TIWBaseForm” parameter? – should I be freeing any that is passed in, or setting back the value of the form I create here?

