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.

Evento Chromium.SendProcessMessage(PID_RENDERER, TempMsg);

Post Reply
euricorc
Posts: 1
Joined: Mon Jan 23, 2023 12:07 pm

Evento Chromium.SendProcessMessage(PID_RENDERER, TempMsg);

Post by euricorc »

Good Morning!

Using the Demos, I created an Application that uses a Dll and a SubProcess to initialize the GlobalCEFApp ( TCefApplicationCore ) with the GlobalCEFApp.StartSubProcess. So far so good with initialization and termination and usage.

Now I need to visit the DOM to get the page's HTML. I took the methods and examples of the DOMvisitor Demo and included it in the project, I have a problem where when triggering the Chromium.SendProcessMessage(PID_RENDERER, TempMsg) event, the ChromiumProcessMessageReceived event is not receiving the messages, that is, it is not triggering.

I think it's because of the subprocess.

1 - If I set SingleProcess := True, it enters ChromiumProcessMessageReceived.
2 - If I remove BrowserSubprocessPath := 'SubProcess.exe', it also goes into ChromiumProcessMessageReceived.

The main project only initializes and finalizes the GlobalCEFApp ( TCefApplication ), calling the methods of the custom Dll.
The SubProcess initializes the GlobalCEFApp ( TCefApplicationCore ) always with the same binaries.

How do I need to treat the handles so that the messages are directed to the form that is created by the Dll ( webBrowser ) and not to the subprocess, in case that is the problem.
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Evento Chromium.SendProcessMessage(PID_RENDERER, TempMsg);

Post by salvadordf »

Hi,

Without sample code I can only assume what could be wrong but I'll try to give some hints.

I would add several calls to "CefDebugLog" in some key procedures and events to debug this issue. This could be helpful to know if some procedure in the render process wasn't executed or the execution didn't reach some code line.

Check that GlobalCEFApp.OnProcessMessageReceived is set in the subprocess because that event will be executed in the render process.
Post Reply