473,609 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

AxWebBrowser.En dInit() causes delay !

Hi,

I noticed that my WinForms app was taking a while to start up. I stepped
through the code to find out which line was causing the delay. The delay is
occurring within one of my UserControls whose designer-generated
InitializeCompo nent() method instantiates a web browser control and
eventually calls EndInit() on it. It's that EndInit() call that takes
several seconds to complete.

What's odd is that my application makes extensive use of this particular
UserControl with the embedded web browser, but only the FIRST call to
AxWebBrowser.En dInit() causes the delay. If the user subsequently causes
more of these custom UserControls to be created, the AxWebBrowser.En dInit()
calls are completed immediately. There is no delay at all.

How can I avoid the delay on the initial call to AxWebBrowser.En dInit()?
For completeness, the InitializeCompo nent() code of my custom user control
looks like this:

** Note that the name of the class is WelcomeControl and the name of the
WebBrowser control is 'WB'.

private void InitializeCompo nent(){
System.Resource s.ResourceManag er resources = new
System.Resource s.ResourceManag er(typeof(Welco meControl));
this.WB = new AxSHDocVw.AxWeb Browser();
((System.Compon entModel.ISuppo rtInitialize)(t his.WB)).BeginI nit();
this.SuspendLay out();
//
// WB
//
this.WB.Dock = System.Windows. Forms.DockStyle .Fill;
this.WB.Enabled = true;
this.WB.Locatio n = new System.Drawing. Point(0, 0);
this.WB.OcxStat e =
((System.Window s.Forms.AxHost. State)(resource s.GetObject("WB .OcxState")));
this.WB.Size = new System.Drawing. Size(312, 280);
this.WB.TabInde x = 0;
//
// WelcomeControl
//
this.Controls.A dd(this.WB);
this.Name = "WelcomeControl ";
this.Size = new System.Drawing. Size(312, 280);
((System.Compon entModel.ISuppo rtInitialize)(t his.WB)).EndIni t();
this.ResumeLayo ut(false);

}

Thanks,

Lecture
Jul 21 '05 #1
0 1542

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

Similar topics

0
2907
by: Matthias Kwiedor | last post by:
I have a aplication which hosts an axWebbrowser. This activex component needs about 10 to 15 mb of memory. Because i have a option to move the aplication to tray icon and do some timer work i don't want that it just spends over 10mb for nothing. So i remove the axwebbrowser with axwebbrowser1.dispose() which works fine. After show the application back from the tray icon i will implement the axwebbrowser again with the same i did it...
3
10201
by: Clint MacDonald | last post by:
I have used the AxWebBrowser in a Visual Basic Project... I found that both Framework 1.0 and 1.1 had to be installed for it to work properly. I now have found that in Studio 2003, that the probablem has come back even if both are installed. When I open a windows form that has the Browser on it and try to Navigate to a page using the OnEnter or OnLoad events, the page just sits there and does
0
1283
by: Scott | last post by:
Hi All, I'm fairly new to VB.NET so I don't know if this is me or what, if I drop a AxWebBrowser COM control on an MDI Child form, and run the program, it appears to lock up as it's loading the form, take it off the form, and it runs fine....I then put it back on, and Rem'ed out the line below from the 'windows designer generated code' region, and it works great! CType(Me.AxWebBrowser1, System.ComponentModel.ISupportInitialize).EndInit()...
0
358
by: Lecture Snoddddgrass | last post by:
Hi, I noticed that my WinForms app was taking a while to start up. I stepped through the code to find out which line was causing the delay. The delay is occurring within one of my UserControls whose designer-generated InitializeComponent() method instantiates a web browser control and eventually calls EndInit() on it. It's that EndInit() call that takes several seconds to complete. What's odd is that my application makes extensive use...
13
4218
by: Udhay | last post by:
I am trying to use the AxWebbrowser control in my VB.Net application. The control is placed on one of the tab pages in the form. This is the error I am getting when I have the 'exceptions' set to break into the debugger: A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in system.windows.forms.dll Additional information: Unknown error
0
2045
by: sagar.jawale | last post by:
Hi, In my c# windows application, i am using AxSHDocVw.AxWebBrowser. I am displaying a generated receipt html in this browser. Also, for printing the same html, i am using the following command : axWebBrowser2.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER,ref empty,ref empty);
1
1809
by: Claire | last post by:
I'm using C# in Visual Studio 2003, XP pro with latest IE plus all patches and security updates. I imported microsofts web browser control onto my tool palette from the COM tab of "Add/remove toolbox items". When I drop the web browser onto a form, AxSHDocVw and SHDocVW are automatically added to my references list. When I run the application, it breaks on the last line of the following code snippet with exception
8
14655
by: Bryan | last post by:
Hello all. I'm fairly new to c++. I've written several programs using std::vectors, and they've always worked just fine. Until today. The following is a snippet of my code (sorry, can't include all of it- it's over 1k lines long). In addition, I'm including an "include" file where structures like "stack" are defined. Again, it's really long. I doubt the problem lies there, though, because the include file is used in many other...
1
1351
by: tim2006 | last post by:
When i try to run the program, it just hangs. If i remove the axwebbrowser control it works fine. Any ideas? Here is my code: class1.vb Imports System.Windows.Forms Imports System.Threading
0
8145
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
8095
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
8588
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...
1
8236
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
7030
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
6068
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
4103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2541
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
0
1407
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.