How to: Referencing a DLL

  • Thread starter Thread starter Chang
  • Start date Start date
C

Chang

Actually I am not sure how to word this question, I will try my best.

[ Problem ]
Remove all the HTML code from a give *.html file and show it as text file.

[ My Solution ]
I am using WebBrowser to open (local) html file and using MSHTML to get text
from <body> part of html file.

[ Code ]
// create DocumentClass object by casting
mshtml.HTMLDocumentClass webPage =
(mshtml.HTMLDocumentClass) this.axWebBrowser1.Document;
// get text out of DocumentClass object
this.rtfBox.Text = webPage.body.innerHTML;

[ New Problem ]
I have referenced WebBrowser and MSHtml in my solution. I see InterOp
working here and creating axWebBrowser for me so that I can use it. Now if I
deploy this project some place then do I need to worry about these files
being installed (with the correct version I am referencing to) or I need to
install these files and register them in registry in the target machine? Not
to over lap my first question, is there a better way then my solution?

Thanks,
Chang
 
Hi,

When you are using a COM (unmanage code) in your manage application the
tlibimp command is used by the IDE behind the seen to create a wrapper
around the COM object. but specifically talking about the browser com you
don't have to worry about the version issue if the OS is higher than win 98.
that mean you don't have to deploy the actaul com object (shdocvw.dll) with
ur application. But in some win 98 machine you may encounter some problems..
to solve this.. right click on the referece and select property and select
to "copy to local". this will basically copy the shdocvw.dll to your app
working folder, whcih ultimately solve teh problem you will face with win
98. as far as I can remember same applies to HTML DOM as well. (add the
referece and select copyt to local) This way you should run ur app any where
that any MS .Net application runs..

Nirosh.
 
Thx.

Champika Nirosh said:
Hi,

When you are using a COM (unmanage code) in your manage application the
tlibimp command is used by the IDE behind the seen to create a wrapper
around the COM object. but specifically talking about the browser com you
don't have to worry about the version issue if the OS is higher than win
98.
that mean you don't have to deploy the actaul com object (shdocvw.dll)
with
ur application. But in some win 98 machine you may encounter some
problems..
to solve this.. right click on the referece and select property and select
to "copy to local". this will basically copy the shdocvw.dll to your app
working folder, whcih ultimately solve teh problem you will face with win
98. as far as I can remember same applies to HTML DOM as well. (add the
referece and select copyt to local) This way you should run ur app any
where
that any MS .Net application runs..

Nirosh.

Chang said:
Actually I am not sure how to word this question, I will try my best.

[ Problem ]
Remove all the HTML code from a give *.html file and show it as text
file.

[ My Solution ]
I am using WebBrowser to open (local) html file and using MSHTML to get text
from <body> part of html file.

[ Code ]
// create DocumentClass object by casting
mshtml.HTMLDocumentClass webPage =
(mshtml.HTMLDocumentClass) this.axWebBrowser1.Document;
// get text out of DocumentClass object
this.rtfBox.Text = webPage.body.innerHTML;

[ New Problem ]
I have referenced WebBrowser and MSHtml in my solution. I see InterOp
working here and creating axWebBrowser for me so that I can use it. Now
if I
deploy this project some place then do I need to worry about these files
being installed (with the correct version I am referencing to) or I need to
install these files and register them in registry in the target machine? Not
to over lap my first question, is there a better way then my solution?

Thanks,
Chang
 
Back
Top