Create a web browser component in MM2.5

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Create a web browser component in MM2.5

Post by trixmoto »

In MM2.4 and before, when creating a web browser component you needed to Naviagate to "about:" to initialise the Document. However, in MM2.5 this gives you a blank document and fails to load anything else you write to it. Here is the code I use to get around this problem:

Code: Select all

   Set WB = UI.NewActiveX(Form, "Shell.Explorer") 
   WB.Common.Align = mmAlignClient      ' Fill all client rectangle 
   WB.Common.ControlName = "WB"
   If SDB.VersionHi=2 and SDB.VersionLo<5 Then WB.Interf.Navigate "about:"
   Set doc = WB.Interf.Document 
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
jiri
Posts: 5431
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Post by jiri »

To explain, the code from 2.4 caused problems for some users (web controls didn't work at all for them) and so 2.5 introduced some better internal handling causing that the isn't any need to navigate to 'about:'.

Jiri
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Sorry, reading it back my post did seem a bit off. I wasn't trying to suggest you'd introduced a bug or anything. The navigating to "about" was always a workaround and I'm glad you've removed the need for it.

I just like to keep my scripts backward compatible! :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Risser
Posts: 184
Joined: Thu Mar 03, 2005 11:28 am

Post by Risser »

That's a handy piece of advice.
The only way I could get it to work was to initialize and update the progress bar. I have no idea why, but I had one that worked and one that didn't and that seemed to be the only difference.

Thanks for the pointer!
Peter
Post Reply