473,903 Members | 3,258 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Documen t 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 .MarshalDirecti veException
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 4780
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
2889
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 which uses a web browser control. As soon as any numeric entity gets put into the browser control, it's lost. It will display properly. But it can't be then read back out with document.body.innerHTML (or outerHTML). It's
1
1149
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 my firewall denying the application and I am unsure as to what is going wrong. Can anyone help?? Thanks . private AxSHDocVw.AxWebBrowser axWebBrowser1; ............................ private void OnlineViewer_Load(object sender,...
7
2372
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
8825
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 because I found this control provided no mouse related event handler and I also have no idea that when I select a text, how can I get it? Many thanks for any suggestions.
0
1196
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 component on a page and call its methods directly - eg locating via the MSHTML document model. Has anyone done this please in C# ? The actual application is that I want to control the Acrobat component's printing and presentation more finely when a...
1
3699
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 after the .submit (see code) Even if i try to start the class in a new thread it terminates at the ..submit
10
3277
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, width, height resolutely refuses to do this, as it remains docked top-left at around 100,100 within the form, with a size of approx 300,250. How do I fill the winform with the wb control? Reading further, it looks like another argument for...
0
981
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 the event. MSHTML.IHTMLEventObj pobjEvent = ((MSHTML.IHTMLDocument2)
2
6441
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 populated with nodes that when clicked play an audio clip from specified local or web URL and navigate the browser control to a specified local or web URL. Audio playback uses as hidden media player object AxWMPLib.AxWindowsMediaPlayer).
4
1442
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 populate some form fields, browse to the appropriate button on the page and then call it's click method. This works just fine using HTTP. However, one of the web pages changed to HTTPS (actually 2 of them have). Now, the click does not throw an...
0
9999
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9847
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10873
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10983
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9684
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8048
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7206
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.