Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / October 2004

Tip: Looking for answers? Try searching our database.

Files required for IE Interop

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
news.microsoft.com - 19 Oct 2004 15:39 GMT
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
Robert Jordan - 19 Oct 2004 18:18 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.