Page 1 of 1

Re: Resource File not loading From DLL

Posted: Mon Mar 04, 2019 8:26 am
by salvadordf
Hi,

Set a break point in that procedure to see where is the exception exactly.

The TChromium.OnGetResourceHandler event is called in a CEF3 thread and perhaps that's the cause of the exception loading a DLL and reading resources from it.

Try loading the DLL in the main thread and then read the resources from TChromium.OnGetResourceHandler. I haven't checked the Delphi TResourceStream's source code but if it's not thread safe I would also add a critical section or mutex to that event.

Re: Resource File not loading From DLL

Posted: Mon Mar 04, 2019 9:08 am
by salvadordf
Move the LoadLibrary call to the TForm.OnShow event but leave the rest of the code that reads the resources in the TChromium.OnGetResourceHandler event.

Delphi uses unicode by default. I would suggest you to convert the text resources to UTF8 and add a <meta charset="UTF-8"> tag to the HEAD section in your HTML.

Use these functions :
http://docwiki.embarcadero.com/RADStudi ... n_Routines