473,670 Members | 2,336 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

AxWebBrowser without form

Hi

Is there anyway to get a WebBrowser to work without placing it on a form.

I want to be able to instantiate a browser, complete some of the fields and
submit, but whenever I try to navigate I get:

An unhandled exception of type 'InvalidActiveX StateException' occurred in
axinterop.shdoc vw.dll

I'm assuming that's because it hasn't got a handle assigned to it, is there
any other method/workaround?

Ideas?

Thanks
Kev
Nov 16 '05 #1
1 2314
Hi,
I'm not sure is this the same problem as the one i had, so maybe this is not
solution for your problem but it wont hurt if you try :)

A handle for AxWebControl is created, not when you create the control but
when it is shown.
The bug here is that when you try to close form which contains AxWebBrowser
control (actually when the GC try to dispose the control) and the control is
not yet shown so it doesn't have handle, it raises exeption similar to the
one you had mentioned.

The solution was to hide the control until you need to show it. So, after:

AxWebBrowser aWB = new AxWebBrowser(); // actually after
InitializeCompo nent();

somewhere in constructor add:

aWB.Hide();

and:

aWB.Show();

when you need to display it!

"Mantorok" <no**@tiscali.c o.uk> wrote in message
news:cr******** **@newsfeed.th. ifl.net...
Hi

Is there anyway to get a WebBrowser to work without placing it on a form.

I want to be able to instantiate a browser, complete some of the fields and submit, but whenever I try to navigate I get:

An unhandled exception of type 'InvalidActiveX StateException' occurred in
axinterop.shdoc vw.dll

I'm assuming that's because it hasn't got a handle assigned to it, is there any other method/workaround?

Ideas?

Thanks
Kev

Nov 16 '05 #2

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

Similar topics

4
3779
by: Martin Ho | last post by:
Hey Everyone, I really hope there is someone who can figure out this problem. Honestly, I spent 3 days now trying to find the solution, but nothing works. I'll try to explain the problem shortly, so I don't take too much of your time. Problem:
0
2910
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...
1
1543
by: Arturo j Torres | last post by:
Hi! I wrote an app to log-in and retrieve a numer of webpages. To do this I have used an AxWebBrowser, controlling the iexplorer with SendKeys (yes, i know this is anything but elegant, but i like the iexplorer doing all dirty work ;). The only problem for this, is that the control must have the focus (and therefore be visible)... Now, i'm trying to make things in a better way, but the
1
1683
by: Christoph L | last post by:
If I open a form in a mdicontainer with an axwebbrowser-control that show´s an excel-document and I close the form first and then the application excel leaves open If I close the application without closing the form first excel closes. Help appreciated.
3
2966
by: Michael C | last post by:
Hi all, Quick question about the AxSHDocVw.AxWebBrowser Component. I was wondering if there is a way to view pages generated internally within my application without writing them to disk. For instance, I'd like to do something like the following: string page = "<HTML><BODY>This is a test.</BODY></HTML>"; And display the page variable's contents in the AxWebBrowser (without
1
1767
by: Les Caudle | last post by:
I created an app that uses an axWebBrowser control to display a local xml file and had no problems. When the form is initially loaded, it displays an htm file that says no file is loaded: object o = System.Reflection.Missing.Value; axWebBrowser1.Navigate(@"file:///" + ((string)(Application.StartupPath + @"\noXml.htm")).Replace(@"\",@"/"), ref o, ref o, ref o, ref o);
3
10202
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
12
6915
by: Don Juan | last post by:
I have had a terrible 10 days period with AxWebBrowser ActiveX Control. I can't understand why there is no goog documentation and tutorials for that monster.
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
8471
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
8386
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
8815
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
8661
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
7421
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
5686
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
4213
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...
0
4393
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1795
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.