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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

VisibleNavigationEntry Access violation

Post Reply
jameshdf
Posts: 3
Joined: Sun Nov 11, 2018 4:59 pm

VisibleNavigationEntry Access violation

Post 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.
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: VisibleNavigationEntry Access violation

Post 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
jameshdf
Posts: 3
Joined: Sun Nov 11, 2018 4:59 pm

Re: VisibleNavigationEntry Access violation

Post by jameshdf »

Ah ok, I understand.
I was able to get all the information I needed. Thanks for the quick response and clarification.
Thanks! :)
Post Reply