PC Review


Reply
Thread Tools Rate Thread

AxWebBrowser without form

 
 
Mantorok
Guest
Posts: n/a
 
      6th Jan 2005
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 'InvalidActiveXStateException' occurred in
axinterop.shdocvw.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


 
Reply With Quote
 
 
 
 
UmmagummA
Guest
Posts: n/a
 
      6th Jan 2005
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
InitializeComponent();

somewhere in constructor add:

aWB.Hide();

and:

aWB.Show();

when you need to display it!

"Mantorok" <(E-Mail Removed)> wrote in message
news:crjf32$e76$(E-Mail Removed)...
> 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 'InvalidActiveXStateException' occurred in
> axinterop.shdocvw.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
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using axWebBrowser on a form Claire Microsoft C# .NET 1 16th Feb 2007 02:45 PM
axWebBrowser hangs in MDI child form? Les Caudle Microsoft C# .NET 1 9th Jan 2005 06:42 PM
Using axWebBrowser in a C# form Gilgamesh Microsoft C# .NET 2 8th Jun 2004 03:45 PM
printing from a html form (AxWebBrowser) =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= Microsoft C# .NET 0 28th Jan 2004 06:11 PM
AxWebBrowser & MDI form not working John Microsoft Dot NET Framework Forms 0 8th Dec 2003 10:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:57 AM.