Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

App doesn't loading anything

Post Reply
Alexeich
Posts: 24
Joined: Fri May 29, 2020 12:15 pm

App doesn't loading anything

Post by Alexeich »

Hello. I'm testing my app in cases of no internet, and if I start it with no internet I normally receive an error in ChromiumMainLoadError (ERR_INTERNET_DISCONNECTED), start timer and everything is ok.
But if I disconnect my internet few seconds later after app starting, I get no errors, see only white screen and nothing happening more, even after internet is on again. Tell me please, how to solve this situation?
User avatar
salvadordf
Posts: 4575
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: App doesn't loading anything

Post by salvadordf »

Hi,

Try using a timeout for your requests and call InternetGetConnectedState to see if you have Internet connection :
https://stackoverflow.com/questions/223 ... connection
https://stackoverflow.com/questions/325 ... ith-delphi
Alexeich
Posts: 24
Joined: Fri May 29, 2020 12:15 pm

Re: App doesn't loading anything

Post by Alexeich »

salvadordf wrote: Fri May 29, 2020 12:55 pm Try using a timeout for your requests and call InternetGetConnectedState to see if you have Internet connection
Thanks, but you mean I can specify a timeout for my LoadURL request, or I should use timer to check had my page been loaded?
User avatar
salvadordf
Posts: 4575
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: App doesn't loading anything

Post by salvadordf »

You can use a simple TTimer or you can also use the Network List Manager (NLM) to get network availability events in your application :
https://theroadtodelphi.com/2015/10/28/ ... om-delphi/

I haven't tried the NLM but it looks very promising.
Alexeich
Posts: 24
Joined: Fri May 29, 2020 12:15 pm

Re: App doesn't loading anything

Post by Alexeich »

salvadordf wrote: Fri May 29, 2020 1:44 pm You can use a simple TTimer
Eh, I hoped I could avoid checking my page loaded fully and normally)
Thank you.
Post Reply