473,765 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web Browser Control

VJ
I am using the web browser control.., I would like to add the control at
runtime...

I was adding the web browser control at desgin time. Now I decided to add
the control at run time so I removed the control from the form and also the
refrences to AxSHDocVw and SHDocVw, then I added the following statments

Dim axwbOfficeDocEd itor As New AxSHDocVw.AxWeb Browser
Me.Controls.Add (axwbOfficeDocE ditor)
axwbOfficeDocEd itor.Dock = DockStyle.Fill

I get the following error,
Type 'AxSHDocVw.AxWe bBrowser' is not defined.

What am I missing?? Can't I add the webbrowser control at run-time?

VJ
Nov 20 '05
12 7637
Hi VJ

Further to the other answers, you will have problems if you remove the two
references AxShDocVw and ShDocVw from your application. The WebBrowser
control needs them, so they must be present.

I am surprised that you say they take a lot of memory when the application
starts up. They should not be loaded until they are required. Try the
following experiment:

Create a new Windows application and drag a WebBrowser control onto the
default form. This will add the two dlls as references. Now delete the
WebBrowser control and run the application in the debugger.

Look at the output window and you will see that the dlls are not loaded.

Now, add the control again, but this time go to the InitializeCompo nent
method and move all the code relating to the creation of the WebBrowser
control into a function LoadBrowser() and place a button on the form that
calls this new function. Run the application again and once more the dlls
are not loaded. Click the button and the dlls are loaded, and the WebBrowser
control appears on the form.

HTH

Charles
VJ wrote:
Hi..

I am not sure this link helps me... If I remove the 2 refernces
"AxSHDocVw and SHDocVw" this project aslo complains the same as mine..

The problem is if I have these 2 references.. they take up like large
memory when project loads...

VJ

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:2h******** ****@uni-berlin.de...
* "VJ" <vi********@yah oo.com> scripsit:
I am using the web browser control.., I would like to add the
control at runtime...

I was adding the web browser control at desgin time. Now I decided
to add the control at run time so I removed the control from the
form and also the refrences to AxSHDocVw and SHDocVw, then I added
the following statments

Dim axwbOfficeDocEd itor As New AxSHDocVw.AxWeb Browser
Me.Controls.Add (axwbOfficeDocE ditor)
axwbOfficeDocEd itor.Dock = DockStyle.Fill

I get the following error,
Type 'AxSHDocVw.AxWe bBrowser' is not defined.

What am I missing?? Can't I add the webbrowser control at run-time?


You can, after you completed these steps:

311303 WebOCHostVB.exe Hosts the WebBrowser Control in Visual Basic
.NET <URL:http://support.microso ft.com/?id=311303>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #11
VJ
I am showing a memory occupancy of 20 MB of our application... I am not sure
about like certain parts.. There is a application which complied as DLL and
called from the Main MDI. I guess the Web Browser control is still added in
design mode in that application. Maybe that reference is getting bottled
up.. Could it be?

I will trim all the parts of the web browser control to runtime and then
give it a shot.. maybe it will come down. I do see the point.. of DLL in
debug window... I will check that out..

Thanks for all your help..
VJ

"Charles Law" <bl***@nowhere. com> wrote in message
news:ea******** ******@TK2MSFTN GP11.phx.gbl...
Hi VJ

Further to the other answers, you will have problems if you remove the two
references AxShDocVw and ShDocVw from your application. The WebBrowser
control needs them, so they must be present.

I am surprised that you say they take a lot of memory when the application
starts up. They should not be loaded until they are required. Try the
following experiment:

Create a new Windows application and drag a WebBrowser control onto the
default form. This will add the two dlls as references. Now delete the
WebBrowser control and run the application in the debugger.

Look at the output window and you will see that the dlls are not loaded.

Now, add the control again, but this time go to the InitializeCompo nent
method and move all the code relating to the creation of the WebBrowser
control into a function LoadBrowser() and place a button on the form that
calls this new function. Run the application again and once more the dlls
are not loaded. Click the button and the dlls are loaded, and the WebBrowser control appears on the form.

HTH

Charles
VJ wrote:
Hi..

I am not sure this link helps me... If I remove the 2 refernces
"AxSHDocVw and SHDocVw" this project aslo complains the same as mine..

The problem is if I have these 2 references.. they take up like large
memory when project loads...

VJ

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:2h******** ****@uni-berlin.de...
* "VJ" <vi********@yah oo.com> scripsit:
I am using the web browser control.., I would like to add the
control at runtime...

I was adding the web browser control at desgin time. Now I decided
to add the control at run time so I removed the control from the
form and also the refrences to AxSHDocVw and SHDocVw, then I added
the following statments

Dim axwbOfficeDocEd itor As New AxSHDocVw.AxWeb Browser
Me.Controls.Add (axwbOfficeDocE ditor)
axwbOfficeDocEd itor.Dock = DockStyle.Fill

I get the following error,
Type 'AxSHDocVw.AxWe bBrowser' is not defined.

What am I missing?? Can't I add the webbrowser control at run-time?

You can, after you completed these steps:

311303 WebOCHostVB.exe Hosts the WebBrowser Control in Visual Basic
.NET <URL:http://support.microso ft.com/?id=311303>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


Nov 20 '05 #12
Hi VJ,

Do you have maybe the webbrowser in a special class while you have not used
the component model.component as base class for that?

Or when you did, do not dispose that class?

Cor
Nov 20 '05 #13

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

Similar topics

2
2377
by: dxben | last post by:
I am considering a situation where I have (n) number of form windows, each with an instance of the Microsoft Web Browser Control (IE) on each form. In each web browser control is an HTML page that has a Java applet. This is the only way I am aware of to get a Java applet to paint within a .NET Forms window. Given that scenario I am trying to determine whethere there would be one Java VM loaded for all of the (n) applets inside the (n) MS...
1
3208
by: Mark Johnson | last post by:
I wonder if anyone has a solution? I wanted to use the web browser control as a 'zoom' box for a smaller textbox. I can format in the control, and save whatever formatting as HTML code back to the textbox when the web browser is closed. The only problem comes in the use of numeric entities to specify Unicode. The web browser control is fine when it comes to named entities, like &nbsp; . And there are a lot of named entities, just...
0
2883
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
7630
by: Praveena | last post by:
Hi All, I am developing a Web Page in ASP.NET where i am using a Web Browser control. I created this selecting the "Microsoft Web Browser" in the custom controls. Now the problem is with the access. Once I drag and drop this control on the ASPX page then some code like this gets added to the WebForm1.aspx OBJECT language="C#" id="mybrowser" with a class id and a list of properties.
28
564
by: BobAchgill | last post by:
Has anyone had success with using this Com control? When I add it into my tool box and drop it into my form it says in the properties that the Document and LocationURL are read only. (they are grayed out) I am successful to get Media Play Com to work alright in the form but can not get Web Browser to work.
1
4775
by: Oenone | last post by:
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()
0
1625
by: Pieter | last post by:
Hi, I've a activex browser control in a form. I've added proxy server support to the control by modifying the proxy server settings in the registry. This works fine before the browser control is created (the browser control is only created after a button on the form is pressed). However, once the initial proxy settings are commited and the browser control is created, the browser control does not respond to any new settings even though...
1
2359
by: john conwell | last post by:
I'm using the Browser control to display html that my application generates. Some times i want a javascript to run when the html gets displayed in the browser control, and sometimes i dont. Is there a way to invoke a javascript function from the browser control? or maybe inject some javascript vis the control's reference to the Document object? I think i can do it with the Window object, but I have seem to figout out how to get to the...
5
2069
by: jeremy | last post by:
I have an ASP.Net 2.0 application running on Windows Server 2003. The application displays properly in Internet Explorer, however, when I use a browser control embedded in a .net form, I get an error and am directed to the Windows Application Event Log. The following message is logged: ------------- Source: ASP.NET 1.1.4322.0 Event ID: 1062
0
9568
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
9399
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
10163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8832
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
7379
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
6649
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
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.