Solved

Getting CWebBrowser2 navigation result

Posted on 2009-05-08
1
367 Views
Last Modified: 2013-11-20
Hi Experts,

I'm a novice in using CWebBrowser Active X Control.  
I would like to know the followings:
1. If I use the CWebBrowser2 Object in my MFC application, is it possible for others to run my application on their PC without IE 4 or later installed.  

2. I am using the CWebBrowser.Navigate() to send some HTTP/CGI command to a third party application, may I know how can I get the HTTP response received by the CWebBrowser object?  (For example, the third party application returns an HTTP 200 response with some text result string).  

Some simple code samples are greatly appreciated.
0
Comment
Question by:cskiong
1 Comment
 
LVL 49

Accepted Solution

by:
DanRollins earned 250 total points
ID: 24347680
The 200 response is a code in the headers, and as far as I know, the browser control does not directly expose the return headers. However, the rest of the response will be righ there in the "payload" -- the document text.
When you use a webrowser to access that page, what do you get on screen?
If you provide the URL, I'll see if I can give you more info.
Also:
There are alternate ways to get data from a web server. For instance, use the WinInet functions,
    About WinINet
    http://msdn.microsoft.com/en-us/library/aa383630(VS.85).aspx
which do provide access to the return headers (assuming you need that info -- you usually don't). Also, the
XMLHttpRequest object
http://msdn.microsoft.com/en-us/library/ms535874(VS.85).aspx
will also work simply and cleanly (ignore the word XML in the name -- it needs not use XML at all). After a response is received, you can easily access the headers using the getResponseHeader member function.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
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.

747 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

12 Experts available now in Live!

Get 1:1 Help Now