473,946 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't Add Reference to MSHTML

I have tried it in Vb2005, vb2008, and CS2008. The program just hangs
up with an hour glass. I downloaded a program with that reference
added and it didn't work. I can add it to vb6 with no problem. I have
Microsoft HTML Object Library version 4.0. I can add references to
other objects.

What I actually need is a webbrowser on my a form. When someone
highlights text, I want to have that text, or better, a reference to
the html element which highlighted available to my vb.net code. I use
vb2008 express edition. I have read that this is not possible with the
2.0 webbrowser alone, but only by adding an unmanaged com object. I
would rather not do that, but tried and failed anyway.
Jun 27 '08 #1
6 2850
On Apr 28, 11:38 pm, cellocoder <celloco...@yah oo.comwrote:
I have tried it in Vb2005, vb2008, and CS2008. The program just hangs
up with an hour glass. I downloaded a program with that reference
added and it didn't work. I can add it to vb6 with no problem. I have
Microsoft HTML Object Library version 4.0. I can add references to
other objects.

What I actually need is a webbrowser on my a form. When someone
highlights text, I want to have that text, or better, a reference to
the html element which highlighted available to my vb.net code. I use
vb2008 express edition. I have read that this is not possible with the
2.0 webbrowser alone, but only by adding an unmanaged com object. I
would rather not do that, but tried and failed anyway.
Having VB 2005 express, it hangs, too. Don't know why.

By the way, also adding WIA Video Preview Class to toolbox from "COM
components tab" makes Visual Studio crash and quit suddenly by itself
on VB and C# both.

My wild guess, the libraries may have some uncompatible unmanaged code
that causes problem :(

Onur
Jun 27 '08 #2
On Apr 29, 12:46 am, kimiraikkonen <kimiraikkone.. .@gmail.comwrot e:
On Apr 28, 11:38 pm, cellocoder <celloco...@yah oo.comwrote:
I have tried it in Vb2005, vb2008, and CS2008. The program just hangs
up with an hour glass. I downloaded a program with that reference
added and it didn't work. I can add it to vb6 with no problem. I have
Microsoft HTML Object Library version 4.0. I can add references to
other objects.
What I actually need is a webbrowser on my a form. When someone
highlights text, I want to have that text, or better, a reference to
the html element which highlighted available to my vb.net code. I use
vb2008 express edition. I have read that this is not possible with the
2.0 webbrowser alone, but only by adding an unmanaged com object. I
would rather not do that, but tried and failed anyway.

Having VB 2005 express, it hangs, too. Don't know why.

By the way, also adding WIA Video Preview Class to toolbox from "COM
components tab" makes Visual Studio crash and quit suddenly by itself
on VB and C# both.

My wild guess, the libraries may have some uncompatible unmanaged code
that causes problem :(

Onur
Note and little correction, deleting WIA Video Preview Class activeX
control from form makes VS crash/quit suddenly, not adding.

For your problem, to highlight text on your webbrowser, you can hook
IE's find findow using
SendKeys.Send(" ^f")
Thanks

Onur
Jun 27 '08 #3
>
For your problem, to highlight text on your webbrowser, you can hook
IE's find findow using
SendKeys.Send(" ^f")
What I need is for the user to select by highlighting text, which
doesn't involve Find. You're the only person I can find who has had
crashes putting COM into .NET. It seems to work for everybody else.

Jun 27 '08 #4
On Apr 29, 9:54*pm, cellocoder <celloco...@yah oo.comwrote:
For your problem, to highlight text on your webbrowser, you can hook
IE's find findow using
SendKeys.Send(" ^f")

What I need is for the user to select by highlighting text, which
doesn't involve Find. You're the only person I can find who has had
crashes putting COM into .NET. It seems to work for everybody else.
Hi,
Based on my understanding, if you want to get selected(highli ghted)
text in browser using Webbrowser control, the unique solution i've
generated is:

' First select some text on a webpage
' Copy selected text to clipboard using:
webbrowser1.Doc ument.ExecComma nd("copy", False,
webbrowser1.Doc ument.ActiveEle ment.All)

' Finally get text from clipboard
Clipboard.GetTe xt.ToString
Note: It's unfortunate that webbrowser control doesn't provide
"selection" object natively. And by the way, there are much more COM-
based ActiveX controls or classes that crashes VS when they're being
added or removed or used on VS. In some cases .NET components /
component tab (references) aren't enough as COM tab, but as i stated
COM tab items are completely instable on VB.NET / VB 2005 express at
least.

Hope this helps,

Onur Güzel
Jun 27 '08 #5
On Apr 29, 12:13*pm, kimiraikkonen <kimiraikkone.. .@gmail.comwrot e:
On Apr 29, 9:54*pm, cellocoder <celloco...@yah oo.comwrote:
For your problem, to highlight text on your webbrowser, you can hook
IE's find findow using
SendKeys.Send(" ^f")
What I need is for the user to select by highlighting text, which
doesn't involve Find. You're the only person I can find who has had
crashes putting COM into .NET. It seems to work for everybody else.

Hi,
Based on my understanding, if you want to get selected(highli ghted)
text in browser using Webbrowser control, the unique solution i've
generated is:

' First select some text on a webpage
' Copy selected text to clipboard using:
webbrowser1.Doc ument.ExecComma nd("copy", False,
webbrowser1.Doc ument.ActiveEle ment.All)

' Finally get text from clipboard
*Clipboard.GetT ext.ToString

Note: It's unfortunate that webbrowser control doesn't provide
"selection" object natively. And by the way, there are much more COM-
based ActiveX controls or classes that crashes VS when they're being
added or removed or used on VS. In some cases .NET components /
component tab (references) aren't enough as COM tab, but as i stated
COM tab items are completely instable on VB.NET / VB 2005 express at
least.

Hope this helps,

Onur Güzel
Thanks Onur. If I understand this right, it is possible to "walk the
DOM tree" without using MSHTML. I will work on this. There are many
people out there who say you need MSHTML for that. One other question:
your third prarameter is "webbrowser1.Do cument.ActiveEl ement.All".
The documentation defines it thus:

value: The value to assign using the command. Not applicable for all
commands.

Do you know what this actually means?

Btw, I was in Ankar for a couple days. Awesome people there. The
kindest in the world. I almost stayed.
Jun 27 '08 #6
On May 3, 5:24 pm, cellocoder <celloco...@yah oo.comwrote:
On Apr 29, 12:13 pm, kimiraikkonen <kimiraikkone.. .@gmail.comwrot e:
On Apr 29, 9:54 pm, cellocoder <celloco...@yah oo.comwrote:
For your problem, to highlight text on your webbrowser, you can hook
IE's find findow using
SendKeys.Send(" ^f")
What I need is for the user to select by highlighting text, which
doesn't involve Find. You're the only person I can find who has had
crashes putting COM into .NET. It seems to work for everybody else.
Hi,
Based on my understanding, if you want to get selected(highli ghted)
text in browser using Webbrowser control, the unique solution i've
generated is:
' First select some text on a webpage
' Copy selected text to clipboard using:
webbrowser1.Doc ument.ExecComma nd("copy", False,
webbrowser1.Doc ument.ActiveEle ment.All)
' Finally get text from clipboard
Clipboard.GetTe xt.ToString
Note: It's unfortunate that webbrowser control doesn't provide
"selection" object natively. And by the way, there are much more COM-
based ActiveX controls or classes that crashes VS when they're being
added or removed or used on VS. In some cases .NET components /
component tab (references) aren't enough as COM tab, but as i stated
COM tab items are completely instable on VB.NET / VB 2005 express at
least.
Hope this helps,
Onur Güzel

Thanks Onur. If I understand this right, it is possible to "walk the
DOM tree" without using MSHTML. I will work on this. There are many
people out there who say you need MSHTML for that. One other question:
your third prarameter is "webbrowser1.Do cument.ActiveEl ement.All".
The documentation defines it thus:

value: The value to assign using the command. Not applicable for all
commands.

Do you know what this actually means?

Btw, I was in Ankar for a couple days. Awesome people there. The
kindest in the world. I almost stayed.
Hi cellocoder,
I used "webbrowser1.Do cument.ActiveEl ement.All" to copy every kind of
element to clipboard including pictures and text data. However
changing "All" to "InnerText" didn't change much things based on my
testings, maybe it's site-specific.

For the "value" parameter's description, again my guess, that the
command ("copy") will use this parameter to make the work, in this
case "copy" command copies "webbrowser1.Do cument.ActiveEl ement.All"
data to clipboard. I hope there were much better ways to handle
document like old MSHTML object, but it hangs when you reference it on
VB 2005 express, too.

BTW, you visited Ankara, the capital city of Turkey? I went there for
once. I hope you enjoyed ! :)

Thanks,

Onur
Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
8043
by: Sunny | last post by:
Hi all, dev. env.: VS.Net2003/C# I have a windows form application with web browser control. I need to capture the onsubmit event of the forms in the document in order to get the values and log them. I have tried this: 1.
1
7797
by: Dean Hallman | last post by:
I need to ensure client machine has Microsoft.mshtml installed in the GAC. And if not, deploy it. My app is a Browser Helper Object and depends on mshtml. Initially, I thought I could take care of deploying mshtml within my install ..msi (VS.NET setup/deploy project). But if I simply add mshtml to the GAC from my install, the install fails near the end with the error:
4
17656
by: David Pendrey | last post by:
Hello all, I am using the WebBrowser control to browse a webpage containing frames and am having difficulties accessing the 'frames' property of a document object. Bellow is my code and the error recieved: webAccess.Navigate(URL); // Wait until document is loaded. This part DOES work IHTMLDocument2 mDoc = (IHTMLDocument2)(webAccess.Document); IHTMLFramesCollection2 mFrames = (IHTMLFramesCollection2)(mDoc.frames);
10
11017
by: Hans Merkl | last post by:
Hi, I have written an pap with .NET 2.0 and c# that uses MSHTML. It works fine on my development machine but on machines I deploy it to I get the following exception when ever I call MSHTML. "Could not load file or assembly 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified."
5
1668
by: Greg Vereschagin | last post by:
I'm trying to figure out a regular expression that will match the innermost tag and the contents in between. Specifically, the string that I am attempting to match looks as follows: ....<table>...<table>...>Final<...</table>...</table>... I want to match: <table>...>Final<...</table> from this example. The string could also, of course, look like the following:
5
10932
by: Atara | last post by:
I am trying to convert the following code to VB .Net, I still have some gaps (the lines that are marked with (*)) and also I need an ending condition for the while loop. any help would be appreciated. Thanks. Atara. ------------------------- Original code:
1
11175
by: bernhard schelling | last post by:
Hi, I'm using Visual C# Express and I'd like to build a project available from http://download.microsoft.com/download/f/2/7/f279e71e-efb0-4155-873d-5554a0608523/WSRP.exe Somehow the Refernce to Micosoft.mshtml ist broken. When I click Add Reference in the project, Microsoft.mshtml doesn't show up :( Could anybody point me in the right direction?
6
2641
by: TriFuFoos | last post by:
Hi there, I was wondering if anyone knew if/how to assign an event to a global variable? I tried to do it and IE 7 came back with an error saying "Member not found" My code looked similar to the following: var globalEvevnt; function showPopup(event){ globalEvent = event;
0
1598
by: Nariban Barkan | last post by:
Hi All, In my c# project, i use Microsoft.MSHTML.Dll as reference. It works perfectly fine on the development machine, but on the release machines that are in production use we gets error when user try to load a windows form that uses this reference. the error message is: ****************** System.Reflection.TargetInvocationException: Exception has been thrown by
0
10150
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11552
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11142
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10679
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8240
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7404
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6097
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4525
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3526
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.