Microsoft.mshtml.dll vs. mshtml.dll

A

Ania

My question is, what is the relationship between Microsoft.mshtml.dll
and mshtml.dll? At first I was assuming that the former is an Interop
for the latter. However, Microsoft.mshtml.dll seems to have a "mind"
of its own, due to the fact that Microsoft.mshtml.dll is an PIA.



In my code, which analyzes html DOM, I have plenty of statements of
the form: if ( someDomEl is HTMLSomeClass). Further, all projects
refrence Microsoft.mshtml, and have "#using mshtml". What I've
observed (through quite a bit of time and debugging) is that:



- If the code is built in DEBUG mode, and run on a machine
that has the development environment, and Micorosft.mshtml.dll is in
GAC, all is well.

- If the code is built in DEBUG mode, and run on a machine
that does not have the development environment and no
Micorosoft.mshtml.dll in GAC, thus uses one XCOPY'ied locally, then
the "is" code will not work until something triggers load of both
Microsoft.mshtml.dll and mshtml.dll. In those case the "is" returns
the generic System.__COM for all html objects (until mshtml.dll is
loaded at which point it resolves the classes properly).

- If the code is built in RELEASE mode, then the code does
not work in either environment, one with development installed and one
without.

- If the code is built in RELEASE mode and changed to
explicitly refer to html classes in the context of the namespace,
mshtml.HTMLSomeClass, then the code works but only on machines that
have development environment

- Finally, the *REAL* problem, the code does not ever work on
machines that have no development environment, until mshtml.dll is
loaded. For example, one win form brings up another which hosts
internet browser control. At this point Microsoft.mshtml.dll is
loaded from local directory. Navigating to some page causes
mshtml.dll to be loaded, however the "is" code does not work. Quit
the form with the browser, and bring it up again (both
Microsoft.mshtml.dll and mshtml.dll still loaded) and the "is" code
works!!!!!

Any ideas or insights will be most appreciated!
Ania.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top