Page 1 of 1

VisibleNavigationEntry Access violation

Posted: Sun Nov 11, 2018 5:21 pm
by jameshdf
Using the latest and old libef (Release), when I call any method the VisibleNavigationEntry returns "Access violation".
At the moment I'm trying to get information from the certificate's page, then: VisibleNavigationEntry.SSLStatus.GetX509Certificate...

Do I have to instantiate before?
Using the Demo minibrowser as test.

Example:
ShowMessage(Chromium1.VisibleNavigationEntry.SSLStatus.GetX509Certificate.GetIssuer.GetDisplayName);

Returns:
Access violation at address 006432F7 in module 'MiniBrowser.exe'. Read of address 00000000.

Re: VisibleNavigationEntry Access violation

Posted: Sun Nov 11, 2018 5:48 pm
by salvadordf
Hi,

Chromium1.VisibleNavigationEntry returns NIL if the browser is not initialized and that property can only be called in the CEF UI thread, which is not the same as the main application thread in Delphi.

Several TChromium events are executed in the UI thread like OnLoadingStateChange, OnTitleChange and many more.
Use them to get the VisibleNavigationEntry interface but remember that you can't create or destroy VCL components in different threads.
The safest way to show that information is to save it and then send a message to the form to show the value.

If you still get AV errors after all this check if all the returned interfaces are assigned.

For more info read these pages :
https://magpcss.org/ceforum/apidocs3/pr ... rHost.html
https://magpcss.org/ceforum/apidocs3/pr ... Entry.html
https://magpcss.org/ceforum/apidocs3/pr ... tatus.html
https://magpcss.org/ceforum/apidocs3/pr ... icate.html
https://magpcss.org/ceforum/apidocs3/pr ... cipal.html

Re: VisibleNavigationEntry Access violation

Posted: Sun Nov 11, 2018 10:12 pm
by jameshdf
Ah ok, I understand.
I was able to get all the information I needed. Thanks for the quick response and clarification.
Thanks! :)