Antwise community forums
[VFP9] antview.settings not giving CoreWebView2Settings - Printable Version

+- Antwise community forums (https://forums.antwise.com)
+-- Forum: Antview (https://forums.antwise.com/forumdisplay.php?fid=11)
+--- Forum: Antview for Windows (https://forums.antwise.com/forumdisplay.php?fid=12)
+--- Thread: [VFP9] antview.settings not giving CoreWebView2Settings (/showthread.php?tid=225)



[VFP9] antview.settings not giving CoreWebView2Settings - LOGO Datensysteme - 2025-08-27

Hello dear folks at antwise,

i am happily using antview in our commercial product as an embedded oauth2 experience and it works marvelous in our VFP9 SP2 based program.

Now i would like to extend the usage of antview to displaying PDFs as the webviewer2 is quite capable with that. This works also great.

BUT... there's always one ;-) 

For changing the default PDF-Toolbar i would need to access to the CoreWebView2Settings.HiddenPdfToolbarItems.

After reading documentation I suspected that antview.settings is offereing access to the interface or class of CoreWebView2Settings. When the view is fully initiated antview.settings suggesting it is an object. But this object has no props, no nothing and any try to "set" or access any props or interfaces that might existing on that, is running me into a wall off OLE errormessages.

Given a fully running antview with a displayed pdf showing just fine, i try the following (very simplified):

Code:
local loSettings
loSettings = thisform.antview.settings
loSettings.HiddenPdfToolbarItems = 1

Line 2 works fine and debugger at least shows an object type. But loSettings does not show any object-Props at all at that point.
Line 3 will, when executed, come up with a pretty hard OLE error and c000....05 bringing the test to a screeching halt.

The c00...05 Error in VFP is usually a desatrous mishap in memory-access and only one step away from "instant implosion" of the VFP-instance. So no luck on that end.

Several variations (including trying the get hold of the interface itself with GETINTERFACE(...) ) later it still did not work out. 

So i am giving up and try to get help here.

Any hint, info or help on how to access and use the CoreWebView2Settings Interface in VFP9 using antview1 or antview2 (we have lics for both of them  Big Grin )
The endgoal is simply to alter the CoreWebView2Settings.HiddenPdfToolbarItems to switch Buttons on the PDF-Toolbar on/off.

But in the end the other CoreWebView2Settings-Props/Classes are pretty interesting too  Cool

Thanks and best regards and
met vriendelijke groeten uit Bremerhaven

Michael


RE: [VFP9] antview.settings not giving CoreWebView2Settings - wila - 2025-08-28

Hello Michael,

Thank you for your question.

The property Settings directly exposes the Microsoft CoreWebView2 settings interface - without the wrapper. As such it is probably useless for almost everyone. We should be more clear about that in the help.

A number of the properties in the Settings interface are already available, such as for example the AreBrowserAcceleratorKeysEnabled property is available directly in the AntView interface as BrowserAcceleratorKeysEnabled property.
Adding an extra "Settings" interface for these, although very descriptive, didn't make a lot of sense to us as each interface means needing more scaffolding code in the target development environment.

We'll look into the HiddenPdfToolbarItems property and will contact you by email when we have something that works.

--
Wil


RE: [VFP9] antview.settings not giving CoreWebView2Settings - LOGO Datensysteme - 2025-08-28

Hi Wil,

thanks for your quick reply.

I was already suspecting this. I totaly get it that it is pretty lowlevel as the Interface in Question is pretty versatile and unfortunately to not quite accessable from within VFP9. So would be out of luck with all the nice little settings waiting there to be used.

As the hiddenPDFToolbarItems is the only way to influence the toolbar that is automatically displayed when a PDF is the URL-target/displayed file, i would really appreciate if you could add some litte tweak or even another COMobject-access so that this is really a very powerful ENUM to use:

Microsoft ENUM Definition of HiddenPDFToolbarItems

So i am looking forward to your mail. I will continue to investigate if i could access the Settings-Object vom VFP in some way, but i am pretty sure it is not doable with what is currently coming back from antview.settings.

Do you know, by any chance, the GUID of the Interface of the class you expose on antview.settings? 
Just an idea, but with the exakt Interface-GUID i could try to get an VFP-object for the Interface. But perhaps this is also wishful thinking...

Anyway... thanks again, looking forward for more informations  Big Grin

Regards
Michael


RE: [VFP9] antview.settings not giving CoreWebView2Settings - wila - 2025-08-28

The GUID of the ICoreWebView2Settings7 interface is '{488DC902-35EF-42D2-BC7D-94B65C4BC49C}'

But I personally wouldn't spent too much time on trying to get that to work in VFP9.
We're already working on the property and you should have it before the end of next week (and probably much sooner)

PS: It will be implemented in AntView version 2 as it's a new feature, not a bugfix.
--
Wil


RE: [VFP9] antview.settings not giving CoreWebView2Settings - wila - 2025-08-28

An email with details and a private build has been send to your email address.  Smile
--
Wil