Solved

About IWebBrowser2 object

Posted on 2002-06-20
4
590 Views
Last Modified: 2013-11-20
Hi.
I would like to access the content the IWebBrowser2
navigate. But I'm not familiar with this object. Can
somebody tell me how to do that or where can I find the
sample codes?
0
Comment
Question by:tan
  • 2
4 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
Comment Utility
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
What kinds of access do you need?  What is your ultimate goal?

-- Dan
0
 

Author Comment

by:tan
Comment Utility
I use IWebBrowser2 object in my application and I want to
add some features to my application, such as highlight,
translation (from English to Chinese), etc. I'm not
familiar with this object. So I would like to know how to
access the content the object navigate?
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 100 total points
Comment Utility
There is a DOM (Document Object Model) that lets you access any part of the page.  A good starting point for learning this is by playing around in JavaScript.  Bring up MDSN help on DHTML and write small scripts to access things such as body.bgcolor and so forth.  

Why would I suggest using JScript?  Because C++ makes it very difficult to use COM objects.  Bizarre error occur; text data is in BSTR format an VARIANT data types so each little thing you need to do takes many complex steps in C++.  With JScript it is a snap.  And the objects, methods and attributes are all the same -- so anything you learn can be translated into useful C++ knowledge.

>>I'm not familiar with this object.
The documentation in MDSN is usually geared toward accessing the object via VB or JScript.  However, there are many examples of C++ access, starting here:

Driller (MFC Sample):
http://search.microsoft.com/gomsuri.asp?n=3&c=rp_Results&siteid=us/dev&target=http://msdn.microsoft.com/Downloads/samples/Internet/browser/driller/Default.asp

Access the DOM using an HTA and JScript:
http://msdn.microsoft.com/downloads/samples/internet/browser/simplehta/default.asp

WalkAll accesses the DOM to look at each element:
http://msdn.microsoft.com/downloads/samples/internet/browser/walkall/default.asp

Lots of background info starting here:
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/prog_browser_node_entry.asp?frame=true

-- Dan
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now