473,624 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SP2 breaks AxWebBrowser

My problem is similar to the thread entited, "SP2 kills my AxWebBrowser"
except that I haven't been able to get the fixes to work for me.

I've written an application that uses an embedded WebBrowser control for
most of it's UI. (At the time it seemed like a good idea, but in retrospect
I think it was more work than it was worth.) In it, I first navigate to
about:blank, wait for the browser to be ready, and then write my html to the
control. The code looks something like this:

object o = null;
axWebBrowser1.N avigate("about: blank", ref o, ref o, ref o, ref o);

// Wait for the control the be initialized and ready.
while(axWebBrow ser1.ReadyState != SHDocVw.tagREAD YSTATE.READYSTA TE_COMPLETE)
Application.DoE vents();

// Update the HTML
IHTMLDocument2 doc;
object boxDoc = axWebBrowser1.D ocument;
doc = (IHTMLDocument2 )boxDoc;

doc.body.innerH TML = "";
doc.write(str);

// Use this class for event handling.
// Need to create a function as follows to handle these messages:
// [DispId(0)]
// public void DefaultMethod()
//
// Get the event as follows:
// IHTMLEventObj e = document.parent Window.@event;
doc.onclick = this;

The problem is, that "doc" is now null when I try to retrieve it. So I
assume I need to somehow first display the IE security bar to the user, wait
for them to click on it and then after they have given me permission,
proceed as normal. I've tried simply re-adding the control and shdocvw.dll
but with no luck.

The other thread suggests implementing some interfaces (which I didn't have
to do before, so I'm not sure that I need to now.) Perhaps I just need to
implement one of these interfaces so the IE security bar will display?

So I guess the question is in summary:
1) Why is axWebBrowser1.D ocument null?
2) What is the easiest way to make IE trust my application?

Thanks in advance,
Andy
Nov 16 '05 #1
2 2132
Hi Andy! I think your question belongs in a different group:

http://msdn.microsoft.com/newsgroups...&lang=en&cr=US

Watch for line breaks!

"Andy Heitke" wrote:
My problem is similar to the thread entited, "SP2 kills my AxWebBrowser"
except that I haven't been able to get the fixes to work for me.

I've written an application that uses an embedded WebBrowser control for
most of it's UI. (At the time it seemed like a good idea, but in retrospect
I think it was more work than it was worth.) In it, I first navigate to
about:blank, wait for the browser to be ready, and then write my html to the
control. The code looks something like this:

object o = null;
axWebBrowser1.N avigate("about: blank", ref o, ref o, ref o, ref o);

// Wait for the control the be initialized and ready.
while(axWebBrow ser1.ReadyState != SHDocVw.tagREAD YSTATE.READYSTA TE_COMPLETE)
Application.DoE vents();

// Update the HTML
IHTMLDocument2 doc;
object boxDoc = axWebBrowser1.D ocument;
doc = (IHTMLDocument2 )boxDoc;

doc.body.innerH TML = "";
doc.write(str);

// Use this class for event handling.
// Need to create a function as follows to handle these messages:
// [DispId(0)]
// public void DefaultMethod()
//
// Get the event as follows:
// IHTMLEventObj e = document.parent Window.@event;
doc.onclick = this;

The problem is, that "doc" is now null when I try to retrieve it. So I
assume I need to somehow first display the IE security bar to the user, wait
for them to click on it and then after they have given me permission,
proceed as normal. I've tried simply re-adding the control and shdocvw.dll
but with no luck.

The other thread suggests implementing some interfaces (which I didn't have
to do before, so I'm not sure that I need to now.) Perhaps I just need to
implement one of these interfaces so the IE security bar will display?

So I guess the question is in summary:
1) Why is axWebBrowser1.D ocument null?
2) What is the easiest way to make IE trust my application?

Thanks in advance,
Andy

Nov 16 '05 #2
Sorry about that, this is my first post. Thanks for the tip, I'll repost
there.
Nov 16 '05 #3

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

Similar topics

0
1543
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...
4
4793
by: TF | last post by:
hi, i am using AxWebBrowser control in my C# dot.net windows application. i want to display a web page in the browser that needs some data sent to it through HTML Form 'POST' method. I saw a method 'Navigate' of AxWebBrowser control that has a parameter 'ref object postData' but didn't find any documentation about AxWebBrowser how to use it. i tried a string like "name1=value1&name2=value2" but it doesn't work. Any help?? Thanks
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
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...
0
1585
by: beau | last post by:
Hi, I'm using the AxWebBrowser in a C# WinForms application. I've got the basics working, but need some help controlling the view options for browsing files. How can I disable the "WebView"/Tasks pane on the left side of the file view? I've looked around and know it can be done globally from the registry
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
3
2568
by: MeNotHome | last post by:
I have been trying to find all the properties and methods documentation on the axwebbrowser control. For example a list of follwing and their results axwebbrowser.document.body.outerhtml axwebbrowser.document.body.innerhtml etc etc. thx
7
6785
by: Doe | last post by:
Okay, I've given up on using the "new" WebBrowser in 2005 to do what I want to do -- tabbed browsing. It seems I really need RegisterAsBrowser and Application to get each instance of a browser working on each tab (and those methods are not available in 2005). I found some code on MSDN forums, but the extention didn't really cover RegisterAsBrowser. Someone told me how to do it, but it's in c and basically over my head. Even though he...
6
3762
by: Dave Booker | last post by:
It appears that I cannot correctly install the AxWebBrowser in VS2005. I can instantiate an "AxWebBrowser browser" and refer to its members, properties, and methods. I'm having trouble with the AxWebBrowser.Document: When I print browser.Document.GetType().ToString() at runtime, I get "mshtml.HTMLDocumentClass". But The VS2005 compiler does not recognize the member AxWebBrowser.Document as anything other than a System.Object -- e.g.,...
0
8173
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
8679
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
8335
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
5563
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
4079
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
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2606
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
1
1785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
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.