Discussion:
Help: ShDocVw replacement
(too old to reply)
Arne Saknussemm
2017-11-23 15:32:34 UTC
Permalink
Ok folks, my turn to ask for help; will try to explain the better I can

A friend of mine (ex colleague) got the task to mantain a legacy VB6
app, the program is quite complex and includes a "general purpose" form
used to show various "internet" contents and based on the "ShDocVw" OCX
(basically the IE browser OCX if you want to call it so)

Now, the problem is that some of the external resources (sites) used by
the app, were update in time and, as of today, some of them use recent
CSS and other features which are unsupported by the "old" IE control,
so those page rendering is, to say the best, "screwed"

When my friend asked me for help, my first idea was checking for some
way to integrate Chrome or FF, so I started playing with stuff like the
"SetParent..." API, adding "sendkeys" wrapped inside methods and so on,
but aside of being a clumsy (at least) approach, such an approach
doesn't allow to expose events (e.g. when a page load completes and so
on) and has a number of issues

So I went on and found this https://awesomium.codeplex.com/ now, adding
to that assembly a layer exposing a COM interface I may be able to
build something which VB may interface to, but it isn't exactly a quick
solution, so I decided to keep it in the backburner in case I won't be
able to find something else

So... and here's my request; do you know of any object/class/... which
may allow me to replace the regular "IE Browser" control so that it may
be used to replace the control in a VB project and allow to have some
kind of similar functionality (ok, code changes are expected, btw)

TIA
Ulrich Möller
2017-11-23 17:11:18 UTC
Permalink
Hi Arne,
Post by Arne Saknussemm
Ok folks, my turn to ask for help; will try to explain the better I can
A friend of mine (ex colleague) got the task to mantain a legacy VB6
app, the program is quite complex and includes a "general purpose" form
used to show various "internet" contents and based on the "ShDocVw" OCX
(basically the IE browser OCX if you want to call it so)
Now, the problem is that some of the external resources (sites) used by
the app, were update in time and, as of today, some of them use recent
CSS and other features which are unsupported by the "old" IE control,
so those page rendering is, to say the best, "screwed"
When my friend asked me for help, my first idea was checking for some
way to integrate Chrome or FF, so I started playing with stuff like the
"SetParent..." API, adding "sendkeys" wrapped inside methods and so on,
but aside of being a clumsy (at least) approach, such an approach
doesn't allow to expose events (e.g. when a page load completes and so
on) and has a number of issues
So I went on and found thishttps://awesomium.codeplex.com/ now, adding
to that assembly a layer exposing a COM interface I may be able to
build something which VB may interface to, but it isn't exactly a quick
solution, so I decided to keep it in the backburner in case I won't be
able to find something else
So... and here's my request; do you know of any object/class/... which
may allow me to replace the regular "IE Browser" control so that it may
be used to replace the control in a VB project and allow to have some
kind of similar functionality (ok, code changes are expected, btw)
have you tried to reference the ieframe.dll instead?
It is also possible to modify the the reported document compatibility mode.

Her are some links with some more information:
https://social.msdn.microsoft.com/Forums/ie/en-US/277e68a6-cc93-4047-acab-271137795c62/microsoft-internet-controls-ieframedll-or-shdocvwdll?forum=ieextensiondevelopment
http://www.geoffchappell.com/studies/windows/ie/shdocvw/history/index.htm
https://blogs.msdn.microsoft.com/patricka/2015/01/12/controlling-webbrowser-control-compatibility/

Ulrich
Arne Saknussemm
2017-11-24 07:35:23 UTC
Permalink
:: On Thu, 23 Nov 2017 18:11:18 +0100
:: (microsoft.public.vb.general.discussion)
Post by Ulrich Möller
have you tried to reference the ieframe.dll instead?
Yes, but apparently the issue with newest CSS construct remains, but ...
Post by Ulrich Möller
It is also possible to modify the the reported document compatibility mode.
I forgot about that !! Now maybe it will solve the issue, I'll pass the
information over to my friend and check back if it will solve his issue
with page rendering (CSS and all that)
Post by Ulrich Möller
https://social.msdn.microsoft.com/Forums/ie/en-US/277e68a6-cc93-4047-acab-271137795c62/microsoft-internet-controls-ieframedll-or-shdocvwdll?forum=ieextensiondevelopment
http://www.geoffchappell.com/studies/windows/ie/shdocvw/history/index.htm
https://blogs.msdn.microsoft.com/patricka/2015/01/12/controlling-webbrowser-control-compatibility/
Ulrich
Thank you Ulrich, will report back as soon as I'll have feedback !
Arne Saknussemm
2017-11-24 08:41:08 UTC
Permalink
:: On Fri, 24 Nov 2017 08:35:23 +0100
:: (microsoft.public.vb.general.discussion)
Post by Arne Saknussemm
:: On Thu, 23 Nov 2017 18:11:18 +0100
:: (microsoft.public.vb.general.discussion)
Post by Ulrich Möller
have you tried to reference the ieframe.dll instead?
Yes, but apparently the issue with newest CSS construct remains, but ...
to be clear, I referred to ShDocVw, but in effect it's the "internet
browser control" which, depending from the installed IE version uses
either that or the IEFrame; in both cases page rendering has issues so
I think that applying the compatibility patch to either the sites (are
intranet ones, so it may be possible) or to the client machines
registry may fix the issue; just sent notes to my friends and, as I
wrote, I'll report back here as soon as I'll have news

Thanks again
Mayayana
2017-11-25 03:15:51 UTC
Permalink
"Ulrich Möller" <***@arcor.de> wrote

|
https://blogs.msdn.microsoft.com/patricka/2015/01/12/controlling-webbrowser-control-compatibility/
|

I didn't know about that one. Possible values here:

https://msdn.microsoft.com/library/ee330730%28v=vs.85%29.aspx#browser_emulation

That looks like a very simple solution, and it doesn't
affect normal IE usage or even default WB behavior
except in one's own software.
Arne Saknussemm
2017-11-27 08:19:03 UTC
Permalink
:: On Fri, 24 Nov 2017 22:15:51 -0500
:: (microsoft.public.vb.general.discussion)
Post by Ulrich Möller
|
https://blogs.msdn.microsoft.com/patricka/2015/01/12/controlling-webbrowser-control-compatibility/
|
https://msdn.microsoft.com/library/ee330730%28v=vs.85%29.aspx#browser_emulation
That looks like a very simple solution, and it doesn't
affect normal IE usage or even default WB behavior
except in one's own software.
yes, the only "problem" if we want to call it so, is that you'll have
to apply the registry change on all the client machines; fine if you
just have a handful of clients, not so fine if you have a whole bunch
of them (ok, that may be solved btw, but won't be as quick as using the
"meta" tag on the webpages)
Mayayana
2017-11-27 14:39:29 UTC
Permalink
Post by Mayayana
https://msdn.microsoft.com/library/ee330730%28v=vs.85%29.aspx#browser_emulation
That looks like a very simple solution, and it doesn't
affect normal IE usage or even default WB behavior
except in one's own software.
|
yes, the only "problem" if we want to call it so, is that you'll have
to apply the registry change on all the client machines; fine if you
just have a handful of clients, not so fine if you have a whole bunch
of them (ok, that may be solved btw, but won't be as quick as using the
"meta" tag on the webpages)
|

That's really two different topics. The MS blog link
describes both approaches, but META tags are for
webpage authors. Without something like a MIME
filter they're not accessible on the WB end. So unless
your friend is writing the webpages as well as loading
them, META editing is irrelevant. I was assuming the
pages were online.

The nice thing about the Registry setting is that
it can be applied to only CU and only for your software.
So you don't need permission. A program using a WB
control can just check the IE version and then add
a setting as desired. Simple, clean and complete.

The setting is especially nice in that it can enable
quirks mode options. Quirks mode doesn't work in IE11
without setting the domain for compatibility mode. But
setting FEATURE_BROWSER_EMULATION to 11001 gives
control back to the webpage author: Leave out DOCTYPE
to get quirks mode.
On the down side, the settings values are complicated
and mixed up. The same settings for IE10 are the reverse
of the settings for IE11.

I'd had no idea that the WB was actually stuck in
something like quirks mode. I just assumed it merely
wrapped a browser window. Now I'm tempted to add
this functionality to my own editor that I use for writing
webpages. On the other hand, I've only been writing
IE pages for quirks mode for many years now, and IE
has become a bit player, so it's probably only a relevant
issue in special cases like yours.
Arne Saknussemm
2017-11-27 15:13:56 UTC
Permalink
:: On Mon, 27 Nov 2017 09:39:29 -0500
:: (microsoft.public.vb.general.discussion)
Post by Mayayana
That's really two different topics. The MS blog link
describes both approaches, but META tags are for
webpage authors.
As I wrote, the URLs accessed by the VB6 app belong to some intranet
servers from the same "organization" so it /may/ (I hope so) be
possible to have them changed to include the needed tags, that may be a
first step, then, if it won't work, the second one will be altering the
registry on the client(s)
Post by Mayayana
The nice thing about the Registry setting is that
it can be applied to only CU and only for your software.
true, but may be a PITA in some cases, e.g. if you have a bunch of
clients running the s/w; luckily, eons ago I wrote the automatic
updater for that s/w so it has a way to update components *and* to
somewhat manipulate the system it runs on :)
Post by Mayayana
I'd had no idea that the WB was actually stuck in
something like quirks mode. I just assumed it merely
wrapped a browser window.
Well, to say it all, I stumbled upon the issue some other times in a
past, but then, since I wasn't in charge of some apps anymore I forgot
about that registry hack
Post by Mayayana
Now I'm tempted to add this functionality to my own editor that I use
for writing webpages. On the other hand, I've only been writing IE
pages for quirks mode for many years now, and IE has become a bit
player, so it's probably only a relevant issue in special cases like
yours.
Yet, it may be useful in some cases, the problem now is checking if it
works in this case (Win10, IE11 and pages using HTML5 and CSS3, so they
need the "DOCTYPE" tag to ensure they'll properly render on regular
browsers)
GS
2017-11-23 22:26:39 UTC
Permalink
Just supporting Ulrich's suggestion; -I've used ieframe.dll
(Components...||Microsoft Internet Controls) on a form with considerable
success.
--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
Mayayana
2017-11-24 23:36:33 UTC
Permalink
"Arne Saknussemm" <***@mamber.net> wrote

Now, the problem is that some of the external resources (sites) used by
the app, were update in time and, as of today, some of them use recent
CSS and other features which are unsupported by the "old" IE control,
so those page rendering is, to say the best, "screwed"
The "old" WB is just whatever version of IE you have.
As I understand it, ieframe is just what you see when
IE has tabs. Each tab is a browser window. But it's still
IE.

CSS modifications are not going to apply because
that's server side. But you *might* get some mileage
from userAgent. On the down side, you probably can't
get at that, with the exception of IE11 compat mode.

It's complicated. Each version of IE breaks at least
some compatibility with the past. Many commercial sites
will accomodate them with code like:
If IE7... If IE8 ... If > IE8...
You can see it in the source code of many pages.

If a page is available in "quirks mode" you can render
an IE6 version in all IE versions through IE10. (I write
all my pages that way, so that I can get dependable
display in all IE versions.)

How do you get quirks mode? They have to serve it
to you, which they're not going to do if IE tells them
it's v. 11.
If you set compatibility mode for a given domain, IE11
will change the userAgent to IE7, spoofing it to get
a different page, *if* the site provides such a page.
There's nothing forcing them to care which IE version
you have.

That may be worth pursuing. I don't know where those
settings are offhand, but if your friend can add a domain
to compatibility mode they might get a more functional
page. And if that works to solve their problem then they
only need to find the compatbility settings.

Another longshot option would be a MIME filter to remove
the doctype tag on the way in and thus force IE10 or
earlier to render quirks mode automatically. Or maybe remove
the style tags. But that won't work for normal IE11, unless
you also set quirks mode. And I'm not sure MIME filters are
even functional for IE11.

One problem -- assuming this is IE11 -- is that the
webmaster can't design for quirks mode. In other words,
with IE10 and earlier a page can be rendered in quirks mode
merely by leaving out the doctype tag. With IE11 it only
works if you exempt the domain on your end. All of the
things removed in Edge -- BHOs, VBS, quirks mode, etc
are only available in IE11 in a domain the end user has set
to compatibility mode. Otherwise IE11 is Edge-ish.
Another problem is that even if you set compatibility,
allowing older-style rendering, that will only help if the
site is sniffing the browser and wants to accomodate IE7.

There used to be an Ax control for Firefox, but from what
I've seen it's little more that a Firefox install with a limited
COM interface. Which makes sense: IE is built in. Mozilla
can't be expected to make a 1-2 MB OCX to contain their
browser.

Another option I'd consider, if it's a set number of sites,
would be to consider downloading the webpage via HTTP,
edit it dynamically, and display it locally. That may or may
not be feasible. Some pages these days are little more
than javascript software, pulling in remote libraries and
only producing HTML as it renders.

But if it were me I'd first investigate the pages with IE11.
The WB on Win10 must be wrapping IE11. It's just a light
wrapper around the IE browser window. So it seems odd
that the age of VB should matter.
I'd also want to know a lot more about what's needed
before coming up with solutions. Is it Win10/IE11 or
something else? Does the programmer know anything about
HTML and/or HTTP? What are the pages needed for?
Would extracting information from them be adequate?
And so on.
Arne Saknussemm
2017-11-27 08:16:44 UTC
Permalink
:: On Fri, 24 Nov 2017 18:36:33 -0500
:: (microsoft.public.vb.general.discussion)
Post by Mayayana
The "old" WB is just whatever version of IE you have.
As I understand it, ieframe is just what you see when
IE has tabs. Each tab is a browser window. But it's still
IE.
I know, and changing the UA string won't help if the installed version
of IE doesn't support HTML5 and CSS3; luckily enough, the boxes are
running Win10, so that shouldn't be an issue, or at least I hope so
Post by Mayayana
CSS modifications are not going to apply because
that's server side. But you *might* get some mileage
from userAgent. On the down side, you probably can't
get at that, with the exception of IE11 compat mode.
right, but then, again, it sounds like using IE11 the page rendering
works, so either changing the pages code to ensure it incorporates the
"DOCTYPE" and the "X-UA-Compatible" may possibly solve the issue
Post by Mayayana
Another longshot option would be a MIME filter to remove
the doctype tag on the way in and thus force IE10 or
earlier to render quirks mode automatically. Or maybe remove
the style tags. But that won't work for normal IE11, unless
you also set quirks mode. And I'm not sure MIME filters are
even functional for IE11.
Uhm... maybe I misunderstood, but I thought that to properly render the
document you'd need both the DOCTYPE and the compatibility tag, am I
wrong ?
Post by Mayayana
There used to be an Ax control for Firefox, but from what I've seen
it's little more that a Firefox install with a limited COM interface.
Which makes sense: IE is built in. Mozilla can't be expected to make
a 1-2 MB OCX to contain their browser.
Checked that one out, didn't try it though, but if the IE "fixes" won't
work, it may be worth a check
Post by Mayayana
Another option I'd consider, if it's a set number of sites,
would be to consider downloading the webpage via HTTP,
edit it dynamically, and display it locally. That may or may
not be feasible. Some pages these days are little more
than javascript software, pulling in remote libraries and
only producing HTML as it renders.
Yes, writing or in any case putting together some kind of "proxy" may
be another approach, but then I'm not sure if writing such a beast may
be better than picking the "awesomium" code and adding a layer of COM
on the top of the .NET assembly; at the moment I passed over the IE
"tricks" to my friend and I'm waiting to hear from him, if it doesn't
solve the issue, I'll have to decide how to move on
Post by Mayayana
But if it were me I'd first investigate the pages with IE11. The WB
on Win10 must be wrapping IE11. It's just a light wrapper around the
IE browser window. So it seems odd that the age of VB should matter.
in fact it isn't the "age of VB" but the fact that, by default, the WB
uses a "compatibility" mode which breaks page rendering when HTML5 and
CSS3 are used, again, changing the pages (it can be done, those are
intranet sites) and/or modifying the registry may solve the issue, or
at least I hope so :)
Post by Mayayana
HTML and/or HTTP? What are the pages needed for?
Ok, it's a legacy VB6 application (and a quite big one), now, they
decided to also have a "web version" which, even if somewhat limited
runs in parallel and is used for some tasks while the VB6 remains for
the "backoffice" part (at least that's what I know); the pages opened
by the VB6 app are on intranet servers and the client machines run
Win10, extracting informations doesn't suffice since some of those
pages have options to change the displayed data (requerying, filtering
and then some)

Anyhow, thanks for stepping in !
Mayayana
2017-11-27 15:02:29 UTC
Permalink
"Arne Saknussemm" <***@mamber.net> wrote
Uhm... maybe I misunderstood, but I thought that to properly render the
document you'd need both the DOCTYPE and the compatibility tag, am I
wrong ?
It depends on how you want to render it. DOCTYPE is
HTML5. Up to IE11 MS made a lot of effort to accomodate
webpage authors with IE. Each IE version broke earlier
compatibility. And later versions were moving away from
the basic IE rendering and DOM. But MS provided special
tags that allowed for a single page to target several versions.
They also provided quirks mode. Using specific DOCTYPE tags,
or none at all, would trigger quirks mode. That allows for
writing webpages that render the same in all versions of
IE and produce a result meant to match IE6.

Firefox is similar. I don't know how much it matters because
I don't think FF has changed their rendering nearly as much.
But as I understand it, FF will also render their own quirks
mode if DOCTYPE is left out. That provides a nice way to
maintain consistency without having to test in all versions
of all browsers. (Though it's still not entirely dependable.
I wrote an HTA last week on XP. It's fine on Win7 with IE11,
except that one label on top of a dropdown SELECT is
squished into the dropdown in IE11 but looks fine on IE6.
It's especially odd in that the label is in its own DIV with a
BR after it. Maybe the problem is an IE7 mode in the Win7
vs IE6 on XP? I don't know. IE11 on Win7 won't give me
quirks mode without adding an exception for the domain.
But what about an hTA running locally? It gets complicated
fast. :) But to Microsoft's credit, they've at least done what
they can to minimize the damage caused by tears of
incompatible rendering.
Post by Mayayana
But if it were me I'd first investigate the pages with IE11. The WB
on Win10 must be wrapping IE11. It's just a light wrapper around the
IE browser window. So it seems odd that the age of VB should matter.
|
in fact it isn't the "age of VB" but the fact that, by default, the WB
uses a "compatibility" mode
|

Yes. I apologize for wasting your time with this
earlier post. I hadn't been aware of that behavior
in the WB.

|
Ok, it's a legacy VB6 application (and a quite big one), now, they
decided to also have a "web version" which, even if somewhat limited
runs in parallel and is used for some tasks while the VB6 remains for
the "backoffice" part (at least that's what I know); the pages opened
by the VB6 app are on intranet servers
|

So maybe the META tag is an option. Still, if it were
me I'd set FEATURE_BROWSER_EMULATION to 11000
or 11001, as part of setup or startup.
11001 would have the advantage of properly supporting
both HTML5 a la IE11 and quirks mode a la IE7, but would
do it based on what the webpage author intended.
Maximum adaptability.
Arne Saknussemm
2017-11-27 15:17:48 UTC
Permalink
:: On Mon, 27 Nov 2017 10:02:29 -0500
:: (microsoft.public.vb.general.discussion)
Post by Mayayana
Yes. I apologize for wasting your time with this
earlier post. I hadn't been aware of that behavior
in the WB.
You don't need to, discussing is *always* a good way to bring some
ideas on the table and help dissecting problems and possibly find
solutions, so, again, don't apologize and don't write about "wasting"
it isn't the case !
Post by Mayayana
So maybe the META tag is an option. Still, if it were
me I'd set FEATURE_BROWSER_EMULATION to 11000
as I wrote, I suggested to start using the meta tag and trying some
values, if that won't work, the next step will be using the registry
Arne Saknussemm
2017-11-28 15:47:03 UTC
Permalink
:: On Thu, 23 Nov 2017 16:32:34 +0100
:: (microsoft.public.vb.general.discussion)
Post by Arne Saknussemm
A friend of mine (ex colleague) got the task to mantain a legacy VB6
app, the program is quite complex and includes a "general purpose"
form used to show various "internet" contents and based on the
"ShDocVw" OCX (basically the IE browser OCX if you want to call it so)
Ok, tomorrow morning will probably have news, will update you asap :)
Arne Saknussemm
2017-11-29 14:08:57 UTC
Permalink
:: On Tue, 28 Nov 2017 16:47:03 +0100
:: (microsoft.public.vb.general.discussion)
Post by Arne Saknussemm
:: On Thu, 23 Nov 2017 16:32:34 +0100
:: (microsoft.public.vb.general.discussion)
Post by Arne Saknussemm
A friend of mine (ex colleague) got the task to mantain a legacy VB6
app, the program is quite complex and includes a "general purpose"
form used to show various "internet" contents and based on the
"ShDocVw" OCX (basically the IE browser OCX if you want to call it so)
Ok, tomorrow morning will probably have news, will update you asap :)
Sounds like the "meta" tag works partially, while adding the registry
hack (value = 11001) solved other issues, further testing is needed,
but apparently the two fixes together seemed to, at least, fix most of
the issues

thanks again !

Loading...