Page 1 of 1

while using "LoadRequest" - Getting Access Violation error

Posted: Mon Sep 21, 2020 5:38 pm
by john.augustine
Hi,

I am getting access violation error when i try with "LoadRequest". Please refer the attached screenshot for code and call stack.

Please let me know your thoughts on this.

Used CEFWindowParent, TChromium and Timer.

Thanks & Regards,
John

Re: while using "LoadRequest" - Getting Access Violation error

Posted: Tue Sep 22, 2020 9:34 am
by salvadordf
The TChromium.LoadRequest procedure has these code comments :
https://github.com/salvadordf/CEF4Delph ... .pas#L2431

Code: Select all

// WARNING: This function will fail with "bad IPC message" reason
// INVALID_INITIATOR_ORIGIN (213) unless you first navigate to the request
// origin using some other mechanism (LoadURL, link click, etc).
If you just need to send a POST request then use the URLRequest demo.
https://github.com/salvadordf/CEF4Delph ... t.pas#L256

CEF applications need to handle interface references carefully to avoid crashes. You have to be extremely careful if you use pointers instead of interface references because it's easy to break the reference count. Personally, I wouldn't use a message to send browser pointers to avoid those problems.

Set the interface variables to NIL instead of using "FreeAndNil".

Re: while using "LoadRequest" - Getting Access Violation error

Posted: Wed Sep 23, 2020 11:48 am
by john.augustine
Sure, Thanks so much for your detailed information!

John