Solved

Getting CWebBrowser2 navigation result

Posted on 2009-05-08
1
373 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.

785 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