472,989 Members | 3,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,989 software developers and data experts.

Using Web Browser control (AxShDocVw) to display app-generated HTML

I've reached the conversion of a part of my application from VB6 to VB.NET
which uses the COM Web Browser control to display HTML content generated by
my application.

The general approach used in VB6 is as follows:

Open the form containing the browser
Wait a few seconds for the Browser.Document property to initialise
With the Document object, call the following methods:
.Clear()
.Open()
.Write(html)
.Close

This all works perfectly in VB6. In VB.NET however, I've been completely
unable to get this to work. The Document property of the Browser control is
always Nothing and no matter how long I wait it doesn't ever get set to an
object.

I also tried calling the Navigate() method of the browser object, and also
dropping URLs from other web browser windows into the browser control. In
each case a System.Runtime.InteropServices.MarshalDirectiveExc eption
occurred with the message, "Marshaler restriction: Excessively long string."

Is there something special I need to do in order to use the Web Browser
control in my project?

Can anyone point me to some sample code that displays application-generated
HTML within the browser?

I could really use some help here as this is a critical part of my
application, without it my project will fail. :(

Thanks in advance,

--

(O)enone
Nov 21 '05 #1
1 4746
Oenone wrote:
This all works perfectly in VB6. In VB.NET however, I've been
completely unable to get this to work.


On further investigation, it appears to only be a problem if the form
containing the control is an MDI child form. If I don't set the MdiParent
property then the browser works acceptably (though it raises about a large
number of exceptions as the form opens).

I've tried setting the MdiParent both in the constructor of the Form, the
Load event, even after I set the HTML into the document, but each time the
browser just appears empty.

I can limp by with this operating as it currently is (looking longingly
towards the release of VS2005 with its built-in managed browser control) but
would love to know why this control is acting in the way it is! :)

Thanks,

--

(O)enone
Nov 21 '05 #2

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

Similar topics

0
by: Mark Johnson | last post by:
The last reply got sort of cutoff. So here again: So for anyone interested, here's the simple regexp patterns for the substitutions required. The textbox control is being 'zoomed' in a popup...
1
by: Dougie | last post by:
I am wanting to include a web browser in my application. I have used the COM Microsoft Web Browser control but when I run the applicaiton I get a waiting icon and the page never displays. It's not...
7
by: Mohammed Abdel-Razzak | last post by:
Dear sirs I`ve added Microsoft Web browser componet to my project I`d like to know how can I view a web page in it? thanks Mohammed
1
by: Tony Zhu | last post by:
Hi, all I'm using the web browser(class AxSHDocVw.AxWebBrowser) control in C#. I want to select a text from the web browser and drop it to an edit box. I failed to implement such functionality...
0
by: John Mac | last post by:
I have a program that encapsulates the IE browser via the AxSHDocVw.AxWebBrowser technique. All works fine. It seems to me there should be a way to locate and wire up to an ActiveX/COM...
1
by: Daniel Frede | last post by:
Hello, I Created a AxSHDocVw.AxWebBrowser in a class and want to Post Values to a WebPage. When I use this class in a Windows application, everything is fine, but in an ASPX page it hangs...
10
by: Yuk Tang | last post by:
Another step on the road to enlightenment, aka producing a UI. I've added a webbrowser control to a form, and I want it to fill the space of the form. Playing around with docking, left, top,...
0
by: Bruce | last post by:
I'm trying to convert a web browser control that was using the old AxSHDocVw.AxWebBrowser control and it uses the DefaultMethod something like this: public void DefaultMethod() { // Get...
2
by: hzgt9b | last post by:
Using VS 2003, VB.NET and/or ASP.NET 2.0, BACKGROUND I have a window forms based application that contains a TreeView control and a WebBroswer (AxSHDocVw.AxWebBrowser) control. The TreeView is...
4
by: =?Utf-8?B?RGF2ZSBF?= | last post by:
I have written an application that reads third party web pages. If I am using HTTP everything works fine. I create an AxSHDocVw.AxWebBrowser object and then Navigate2 to the page. I then...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.