473,765 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to control number of instances of Internet Explorer Created

I have been trying to get an instance of internet explorer to navigate to a website using the Navigate2 command. When the navigation request uses the Get method (just a URL) there is no problem. However, when the navigation involves the post method two instances of internet explorer are created. One of the instances is uninitialized while the other correctly navigates to the site. I need to have only one instance created and have it navigate properly.

To demonstrate and simplify the problem, I created a C# windows form project with only a windows web browser (AxShDocVW.AxWe bBrowser (fiWebBrsr)) placed on it. There is a Before_Navigate 2 event on the form that determines if there is an Post data associated with the Navigate2 event. If Post data exists, a new instance of SHDocVw.Interne tExplorer is created and passed the information from the BeforeNavigate2 Event arguments and directed to navigate to the same web site. What is observed is that two instances of an internet explorer will be created. One will successfully navigate to the website indicated. The other one will be tracked by the code but it will be uninitialized. This is the problem I'm trying to resolve. How can the second instance of the internet explorer be prevented and the one being tracked by the code be caused to navigate to the website. I'm using Visual Studio 2008, Internet Explorer 7 and the project is in C#. The code that is associated with the form is shown below:

Expand|Select|Wrap|Line Numbers
  1. namespace Test
  2. {
  3.   public partial class frmSrch : Form
  4.   {
  5.     public frmSrch()
  6.     {
  7.       InitializeComponent();
  8.     }
  9.  
  10.     private void Form1_Shown(object sender, EventArgs e)
  11.     {
  12.       this.fiWebBrwsr.Navigate("http://oregon.jobing.com/");
  13.     }
  14.  
  15.     private void fiWebBrwsr_BeforeNavigate2(object sender, AxSHDocVw.DWebBrowserEvents2_BeforeNavigate2Event e)
  16.     {
  17.       if (!(e.postData == null))
  18.       {
  19.         SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorer();
  20.         ie.Visible = true;
  21.         ie.Navigate2(ref e.uRL, ref e.flags, ref e.targetFrameName,ref e.postData,ref e.headers);
  22.         e.cancel = true;
  23.       }
  24.     }
  25.   }
  26. }
  27.  
Sep 30 '10 #1
0 1508

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1657
by: Rea Peleg | last post by:
link to configuration file prevents user control download to internet explorer Hi I have a simple web application which consists an opening html page with a (windows form user) control which on click event should download an assembley from the server site to client ie. Opening page displays correctly with control when it does not include the
5
5422
by: Adam Stirk | last post by:
Hi, I have a application that I need to create multiple new "iexplore.exe" processes (show more than once in taskmanger) and control them using the shdocvw/mshtml. I am able control Internet Explorer with instances created with the shdocvw. e.g. Activator.CreateInstance(Type.GetTypeFromProgID ("InternetExplorer.Application");
1
1198
by: Wayne Gibson | last post by:
Hi, was wondering if anybody could help. I'm looking to create a control that I can embed in a web browser, be it Internet Explorer or FireFox. I know that these used to be ActiveX's when using VB or VC. Or they were Java applets when using Java. What is the new method when using C#? Is it possible to have it download automatically without informing the user?
1
1071
by: usenet | last post by:
I have written a Control Library in VS2005 (VB.NET) and am trying to use it inside Internet Explorer. I have copied to DLL to the same folder as the web pages. I have tried the control in an HTML file, but the same code in an ASPX script does not work. Also if I recompile the DLL it seems to stop even the simple HTML file working. Here's the object tag I'm using. <object id="usrSheep2" codebase="#Version=-1,-1,-1,-1"...
4
2568
by: redoix | last post by:
Sometimes There To Many Instance Of The Internet Browsing Page Running On The Taskbar. This Slows Down Connection.how Do I Limit The Instances Of Internet Browsers So That One The Limit Is Reached Additional Page Can Not Be Opened
1
4117
by: Adam Clauss | last post by:
We have created an ActiveX control (a series of them actually) which can be loaded into Internet Explorer and accessed via Javascript using the techniques described here: http://support.microsoft.com/kb/555687/en-us Functionally, everything is working as we expect. We can access the C# data we need from Javascript, including firing C# events which invoke Javascript code. However, we started seeing that, should we leave the...
2
3742
by: scdowney | last post by:
First and foremost, thank you in advance for any attempts to help me out. I am working on a project with work, and it requires I use CSS selectors to locate elements within a webpage. For the most part, I have had no issues using the selectors, but I am having a very strange issue which does not seem to make much sense to me. Please advise if you have any input at all. Note, I am keeping this description at a high level for now because I...
1
4328
by: loudey | last post by:
hi I'm making a macro in excel that loads up internet explorer and fills out a form. I'm able to do all of that but i have a hard time to trigger a javascript onchange event that is triggered when a user manuallay types a number in the textbox and clicks outside the box. here is my code for that text box ' Inserts unit sales price IEdoc.All("ctl00$ContentPlaceHolderMain$uxFtc$uxUnitSalesPrice").Value = Cells(i, 10) and here is...
1
5030
by: JMANTN | last post by:
I have data that sometimes needs to be uploaded to a 3rd party website and I’m trying to automate this process with Access 2007. I’m having a difficult time with my VBA syntax and with identifying the HTML names/id’s of objects I want to control. I have referenced Microsoft HTML Object Library & Microsoft Internet Controls and should note the version of Internet Explorer my company currently uses is IE6 (I know can’t wait for an update) ...
2
2000
by: xavierp | last post by:
I just created a website which works fine on Firefox, Opera and Safari but some reason it just has a white tag when i try to open it up in Internet Explorer. I'm only in year 8 so it probably my fault and its probably some Rookie coding mistake but I'd be grateful to anyone he could find and fix the problem or even give me a clue on how to fix it. www.cpu-tricks.co.cc Code in attachments.
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
9398
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
10160
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
10007
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...
0
9832
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
8831
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...
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();...
1
3924
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
2
3531
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.