WebBrowser class

L

Laurent Lequenne

Hello All,


I'm currently developing a free windows Scrabble (in french :)) application
that uses extensively the WebBrowser class of NET 2.0 for configuration, and
data browsing. It works 100% on my machine, with the WebBrowser Class, and
the Microsoft.MsHtml component. I can access all elements on the pages
through the events, I can change some parts. Everything is rendered with
XSLTs and changing directly the document through the msHtml thing.

But apparently, it works only well on both of my machines :)

When I deploy the application, Enabling / Disabling controls does not work
and when the application try to access a SelectElement the users got that
error :
Unable to cast COM object of type 'System.__ComObject' to class type
'mshtml.HTMLSelectElementClass'. COM components that enter the CLR and do
not support IProvideClassInfo or that do not have any interop assembly
registered will be wrapped in the __ComObject type. Instances of this type
cannot be cast to any other class; however they can be cast to interfaces as
long as the underlying COM component supports QueryInterface calls for the
IID of the interface.

The Microsoft.MsHtml is copied with the application and all users have a
correct installation, as it is the only thing that doesn't work

does anyone knows what I have to do, to make it work on machines that
shouldn't be loaded with Visual Studio, as it's the only difference I can
figure out with my machines and users machines ?

Thank you

Laurent
 
V

VJ

I believe the Microsoft.MsHtml is a COM component.. Try registering it when
installing it. If you are using VS Packaging.. there is a option to do this
for a single file in the properties windows. Check the properties, the
property name is pretty obvious..

VJ
 
L

Laurent Lequenne

Euh I don"t thinkk so, it has been found in the NET components into the
references of my project, but maybe it's just a wrapper class, and it's
dependent of another DLL ? But No idea which one :)
 
V

VJ

uhmm.. yes sorry, I just saw that myself... If you are using the browser
object or the MS Browser control, that will its own set of Dlls..uhmm lets
see.. Can you tell me how you are building your setup project?., Just like a
including a Project Output into VS.NET setup project and then building?


VJ
 
L

Laurent Lequenne

Hello VJ :)

No I add the Microsoft.mshtml.dll in addition of the project output and
other things. The application is running well everywhere for
reading/settings values in the forms of the browser. But it does not disable
the controls, and I can not access the options of a select control, however
the value can be read from the value of SelectElementClass. Things that are
working well on my computer.
Really strange

Laurent
 
V

VJ

I am sure you would have checked.. but I am asking.. are these end computers
having the same .NET framework installed as your development machine? If the
end computers have multiple versions, you should makes sure your application
uses whatever version you developed on is being loaded at run-time by your
application. The VS.NET environment does this automatically for you.. This
is just a thought in case you missed it..

or

Do you know how to get dependencies of a specific DLL.. once you get this
dependencies.. you can make sure they are all installed on end computer..

VJ
 
L

Laurent Lequenne

Yes, I tryed to install on my girlf friend's computer, and everything is OK
about the FrameWork and SQL Express 2005. However it's a pain for a normal
user to install all those things :))) About the dependencies no Idea to
get them from a DLL, I already used some assembly viewer, but I didn't found
any suitable information, maybe I didn't got the right one. Any suggestion
is welcome :)

Thanks

Laurent.
 
V

VJ

I did not understand.. let me get this clear... you did copy the mshtml and
install the framework on your friends computer and all is working? or all is
working after you copied mshtml, installed framework and SQL Server 2005?

VJ
 
L

Laurent Lequenne

It's almost working ... Some features found in the mshtml component are not
available. I can not disable controls in the webviewer (however the code is
working, it just not disable controls). I can not access the options of the
select control (this throw an error).
 
V

VJ

The webbroswer is a really tricky component... to install.. if you are
having problems even after installing the framework.. then, you will have to
find dependencies... for each Dll... One way to do is add the file directly
to a setup project, then for the file in the properties window, you can
check dependencies.... or try to get a Tool of the web to do the same...

VJ
 
L

Laurent Lequenne

Ouch!

Unfortunately, when checking the dependencies, it says only the framework...
Unbelievable :)

Laurent
 
V

VJ

Laurent...

MSHTMl says just that.. uhmmm I will have to check more.. I will post back
in a little bit

VJ
 
V

VJ

Laurent... I tried the same below.. it works fine when I deploy the mshtml
file... It does have no dependencies...Maybe its about time you got
dependency analyzer to check the order... did u google to Find out?...

VJ
 
L

Laurent Lequenne

Hello VJ !

Yes I already tryed, and it tells always the same things... Deploy the
MSHTML with your application, but I did ;-) I'll check later, I though
someone could have a quick answer :)

Thank you

Laurent
 

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