[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

About IWebBrowser2 object

Posted on 2002-06-20
4
Medium Priority
?
615 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 49

Expert Comment

by:DanRollins
ID: 7101488
What kinds of access do you need?  What is your ultimate goal?

-- Dan
0
 

Author Comment

by:tan
ID: 7101546
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 300 total points
ID: 7102174
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

649 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