Jump to content

LoginDemo - why TUniLoginForm1 starts first?


elGringo
 Share

Recommended Posts

mohammad thnx! 

 

So, how to repeat it?

 

I created simple App with 1 Main form and 1 Login Form - when I started - I saw Main form. Where is Login form - that shoud start automatically ?)))

 

Then 

I just checked Visible:=false to Main form, and Login form appeared first

 

 also can't understand when and how Login Form was Created ?

 

Didn't see anywhere code like Loginform:=TLoginForm.Create in spite of that everywhere function like

function fEncryptLink_LoginForm: TfEncryptLink_LoginForm;
begin
  Result := TfEncryptLink_LoginForm(UniMainModule.GetFormInstance(TfEncryptLink_LoginForm));
end;

So - how it works in UniGUI - we don't need to create it in memory and Free then? Instances created on Create of Main? Does this approach safe for memory leaks?

Link to comment
Share on other sites

Hi,

I think that when you derive (and register) a form from TUniLoginForm, this form will be automatically created and shown by framework for each new session, unless you especify "Handled:=true" in the OnBeforeLogin procedure of UniMainModule...

Regards,

Link to comment
Share on other sites

Yes, but this handler (OnBeforeLogin) is empty in logindemo.

 

So, I tested

I have 

 

Main form and LoginForm

TfEncryptLink_LoginForm = class(TUniLoginForm)

I start App and i see main Form

 

I set Handled:=true in OnBeforeLogin and it is again MainForm on Start

 

So, how to repeat logindemo? Can't understand)))

Link to comment
Share on other sites

 

I have 

 

Main form and LoginForm

TfEncryptLink_LoginForm = class(TUniLoginForm)

 

Are Main form and LoginForm derived from TUniLoginForm?...

Make sure that only one form is derived from TUniLoginForm and all your forms (login one also) are correctly registered (initialization section with its RegisterAppFormClass)...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...