Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Web Browser Control Script
Message
From
03/11/2017 13:30:45
 
 
To
03/11/2017 00:54:41
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01655166
Message ID:
01655385
Views:
79
IC Tore already put you on the right trail ;-)

I was isolated mostly from that particular change by my desire to minimize calls across COM boundries in the spirit of "chunky, not chatty" from RPC method calling ;-))

if you look closely at the typical lines from Ricks script
oButton = o.document.getElementById('btnSubmit')
? oButton
oButton.Click(.F.)
marshalling is done 4 times, as COM oButton is returned to vfp an a method is called there. I have a standard JS object, which has methods to call which in turn get the Element and call the method in pure JS runtime, eliminating half the marshalling at the cost of some duplicated code on JS side to minimize JS method calls and in a few times additional string comparison. Pattern for signature:

oHelper.click("ButtonName")
oHelper.setstr("ControlName", "NewValue")

and so on. More than 2 decades ago this was markedly faster, probably today still is, even if CPU speeds,RAM access caching and so on changed quite a bit.

A pattern to consider ;-))


>It is not that straightforward, InvokeScript convenience method for .Net, it is not exposed when IE ActiveX is used in Foxpro.
>something like
>oBrowser.Navigate("my_html_file_with_js.html" )
>oBrowser.Document.parentWindow.my_js_function()
>or
> oBrowser.Document.Script.my_js_function()
>is not working anymore.
>It seemed to work in 2008 :)
>https://weblog.west-wind.com/posts/2008/sep/27/calling-javascript-functions-in-the-web-browser-control
>
>
>>Yes, nearly identical, as IE is activeX. Did a lot of that last century when IE was dominant, but today more and more devs want to escape IE problems. Also I found newer versions of IE to be less stable as activeX components than in IE4-IE6 times, but that might be a misperception as back then I spent much more time roboting WebBrowser and InternetExplorer.Application.
>>
>>Unless your need is a short time temp solution, implement with different tool set.
>>
>>>Can I do something similar to Windows Forms and its Web Browser Control in Foxpro form with its Internet Explorer control.
>>>C# line of code
>>>
>>>  webBrowser1.Document.InvokeScript("openPdfAsBase64", new[] { asBase64 });
>>>
Previous
Reply
Map
View

Click here to load this message in the networking platform