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.

Waiting message.

Post Reply
Djota
Posts: 10
Joined: Fri May 05, 2017 12:35 pm

Waiting message.

Post by Djota »

Hi.

well, i took the simplebrowser demo and put a panel with a message please wait and make it visible in the chromium OnLoadStart event and make it invisible in OnLoadEnd.
Problem that after I did that, when I close the browser executable, it gives a memory error.

---------------------------
Chromesgdw
---------------------------
Access violation at address 005E3FEB in module 'ChromeSGDW.exe'. Read of address 00000010.
---------------------------
OK
---------------------------


and if I don't leave the panel visible, the error doesn't happen.
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Waiting message.

Post by salvadordf »

Hi,

TChromium events are executed in CEF threads and it's not safe to create/destroy/modify VCL controls in any other thread different than the main application thread.

Send windows messages from those events to the form in order to show and hide the panel in the main application thread.
Djota
Posts: 10
Joined: Fri May 05, 2017 12:35 pm

Re: Waiting message.

Post by Djota »

Would you have an example to show?
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Waiting message.

Post by salvadordf »

Many demos send a CEF_AFTERCREATED message from the TChromium.OnAfterCreated event to the form because they usually set a caption and enable some parts of the interface:
https://github.com/salvadordf/CEF4Delph ... r.pas#L237

https://github.com/salvadordf/CEF4Delph ... r.pas#L505
Djota
Posts: 10
Joined: Fri May 05, 2017 12:35 pm

Re: Waiting message.

Post by Djota »

Thank you very much for the agility
Post Reply