I have a Windows Forms project that embeds Internet Explorer.
On my development machine all that is required for the application to run is
the 48KB file AxInterop.SHDocVw.dll and the 124KB Interop.SHDocVw.dll. (Btw,
what is the difference between these two? Can I reduce this to just one?).
When I try and run it on pretty much any other non-development machine, I
get a CLR error as the application starts up. After some hunting and
testing, I figured out that it was because I needed to include the massive
7.63MB Microsoft.mshtml.dll.
Is this not included on all machines anyway? Why would I need to distribute
this with my application?
It would be great if I could rid my need of distributing this DLL. Makes the
difference between a 1MB compressed archive and a 3.5MB compressed archive.
RMD
Hi,
> On my development machine all that is required for the application to run is
> the 48KB file AxInterop.SHDocVw.dll and the 124KB Interop.SHDocVw.dll. (Btw,
> what is the difference between these two? Can I reduce this to just one?).
AxInterop: ActiveX wrapper of the WebBrowser control
Interop: Interop assembly of the WebBrowser control
> When I try and run it on pretty much any other non-development machine, I
> get a CLR error as the application starts up. After some hunting and
[quoted text clipped - 3 lines]
> Is this not included on all machines anyway? Why would I need to distribute
> this with my application?
Microsoft.mshtml.dll is the primary interop assembly (PIA) of
MsHtml. It contains all IHTMLxyz interfaces, HTMLxyz coclasses
and event wrappers.
You have to distribute this assembly, because it's not part
of the Runtime. It's either part of the SDK or of VS.NET.
> It would be great if I could rid my need of distributing this DLL. Makes the
> difference between a 1MB compressed archive and a 3.5MB compressed archive.
Take a look at your code how many IHTMLxyz interfaces and HTMLxyz
coclasses you need. If you don't need too many of them, you may try
to create a smaller interop assembly:
// MyHtml.idl, UNTESTED!
[
uuid(db4c4977-bd31-4911-920a-5c233f967b0c)
]
library MyHtmlInterop
{
import "MsHtml.idl";
interface IHTMLDocument;
interface IHTMLDocument2;
interface IHTMlElement;
interface IHTMlElement2;
...
};
Pass that file to MIDL to generate a TLB, which it turn
has to be passed to TlbImp.
Warning: that's not a trivial step! You'll get a lot of
errors from MIDL and you need to fix them.
bye
Rob