Re: modal form call in event TOnGetAuthCredentials
Posted: Fri Sep 21, 2018 12:57 pm
Hi,
Without the code I can only guess what's going on.
Perhaps the form is created and/or shown from inside the TChromium.OnGetAuthCredentials event.
All TChromium events are executed in a different thread than the main thread. In this case, TChromium.OnGetAuthCredentials is executed in the IO thread.
The VCL doesn't like to create and destroy components in different threads. Many VCL components have similar problems setting the "Visible" property because Delphi creates the handle in a different thread. Perhaps TForm.ShowModal has that problem too.
In general, try storing the information you need inside the TChromium events and then send a message to the main form to do whatever you need with that information in the main thread.
Another possibility : Maybe you are calling TForm.Show instead of TForm.ShowModal
Without the code I can only guess what's going on.
Perhaps the form is created and/or shown from inside the TChromium.OnGetAuthCredentials event.
All TChromium events are executed in a different thread than the main thread. In this case, TChromium.OnGetAuthCredentials is executed in the IO thread.
The VCL doesn't like to create and destroy components in different threads. Many VCL components have similar problems setting the "Visible" property because Delphi creates the handle in a different thread. Perhaps TForm.ShowModal has that problem too.
In general, try storing the information you need inside the TChromium events and then send a message to the main form to do whatever you need with that information in the main thread.
Another possibility : Maybe you are calling TForm.Show instead of TForm.ShowModal