WebGadget; SPA; communication App -> WebGadget; PB5.6x

Windows specific forum
HanPBF
Enthusiast
Enthusiast
Posts: 563
Joined: Fri Feb 19, 2010 3:42 am

WebGadget; SPA; communication App -> WebGadget; PB5.6x

Post by HanPBF »

Hello!

What ways do we have to start communicating between PureBasic program and embedded WebGadget.
This must be done using a SPA (singe page application).
So, simply writing a whole new web page is not a good idea;-)

At the moment, I use windows title and #PB_EventType_TitleChange which works from embedded browser to PureBasic.
The step back is handled via file system and JS observing folder.
The file observing is what makes me want another technic.

Maybe WScript/CScript and network?

Btw., ActiveX in internet explorer is possible/I may use!

I need this for offline app which later communicates to web server when connection available again.


Really apreciate any idea!
Thanks a lot!
Regards!
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: WebGadget; SPA; communication App -> WebGadget; PB5.6x

Post by JHPJHP »

Hi HanPBF,

I know we discussed it here and here, but it seems that you are only using the document.title one way; see either of the following posts for a working solution.
- MP4 Player, YouTube Player (search for _Put_ and _Get_)

This is the second time I am posting a response; the last time was in one of your other threads, since removed.
- sorry if you missed it, but I have a policy to delete posts that go unanswered
Last edited by JHPJHP on Wed Aug 23, 2017 9:05 pm, edited 2 times in total.
HanPBF
Enthusiast
Enthusiast
Posts: 563
Joined: Fri Feb 19, 2010 3:42 am

Re: WebGadget; SPA; communication App -> WebGadget; PB5.6x

Post by HanPBF »

Yes, did indeed overread it but can remember the hint to the interface IHTMLDocument2.

Thanks for making it clear again!
That helps a lot!

So, two-way communication with WebGadget via document.title possible!
Great!
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: WebGadget; SPA; communication App -> WebGadget; PB5.6x

Post by IdeasVacuum »

Code: Select all

WebBrowser2\put_Silent(#True)
I use this code myself because so many websites have Java Script errors but it is worth noting that it is not specifically for this purpose - it actually suppresses all dialogue boxes, so that includes those that deliver info such as extended hints.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: WebGadget; SPA; communication App -> WebGadget; PB5.6x

Post by JHPJHP »

Hi HanPBF,

See MP4 Player for additional code that might be of interest...

Dynamically create multiple <article> elements using JavaScript (tested with 100MB of data per element).
- the <pagetitle> tag is used to notify PureBasic that data is ready

PureBasic is then used to retrieve data from each of the <article> elements into a single file.
Last edited by JHPJHP on Mon Aug 28, 2017 5:25 am, edited 3 times in total.
HanPBF
Enthusiast
Enthusiast
Posts: 563
Joined: Fri Feb 19, 2010 3:42 am

Re: WebGadget; SPA; communication App -> WebGadget; PB5.6x

Post by HanPBF »

Really apreciate that example!

I have now IIS with classic ASP (only serving JSON from AJAX/J requests) and are later able to re-embed JS/HTML/CSS into PureBasic.

Then, we have SpiderBasic; so, developing for intranet, embedded or not, can easily be done with one code base for the GUI.

Can not imagine if JS/HTML/DOM could be too slow to manage those things; mandelbrot set graphics would be an example where speed shall be distinct.


Thanks a lot for the source!
Best regards!
Post Reply