473,395 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

IE Control in Winform (FW1.1)

Hi everyone,

I am trying to develop a Winforms app using .NET FW 1.1 (don't want to
use 2.0 for this particular project) and am trying to use the IE
control.
It compiles and builds without any problems. However everytime I run
it in DEBUG and it comes to this line:

this.WebBrowser.Navigate("about:blank", ref flags, ref
targetFrame, ref postData, ref headers);
It throws this error:

System.OutOfMemoryException: Error creating window handle.
I am following this article here for instructions:

http://www.codeproject.com/csharp/ad...chostuihandler
Can anyone please advice how to get around this error; or if there is
an easier way to do this on .NET 1.1 (I need an embedded browser
control)?
Here is the stack-trace:

System.OutOfMemoryException: Error creating window handle. --->
System.NullReferenceException: Object reference not set to an instance
of an object.
at Program.Form1.Form1_Load(Object sender, EventArgs e) in c:
\program\form1.cs:line 92
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean
fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.IntCreate WindowEx(Int32
dwExStyle, String lpszClassName, String lpszWindowName, Int32 style,
Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent,
HandleRef hMenu, HandleRef hInst, Object pvParam)
at System.Windows.Forms.UnsafeNativeMethods.CreateWin dowEx(Int32
dwExStyle, String lpszClassName, String lpszWindowName, Int32 style,
Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent,
HandleRef hMenu, HandleRef hInst, Object pvParam)
at System.Windows.Forms.NativeWindow.CreateHandle(Cre ateParams cp)
--- End of inner exception stack trace ---
at System.Windows.Forms.NativeWindow.CreateHandle(Cre ateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Form.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Control.Show()
at Program.frmMain.mnuFileNew_Click(Object sender, EventArgs e) in
c:\program\frmmain.cs:line 312

Jul 18 '07 #1
2 2367
I'm just guessing here, but I think it has something to do with calling
Navigate before the window is shown (the Load event is fired before the
window is just shown. I seem to remember something similar when using the
object in VB6). Try setting a timer to fire right after the load event, and
then call navigate from there.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"R. K. Wijayaratne" <ra*****@gmail.comwrote in message
news:11**********************@z24g2000prh.googlegr oups.com...
Hi everyone,

I am trying to develop a Winforms app using .NET FW 1.1 (don't want to
use 2.0 for this particular project) and am trying to use the IE
control.
It compiles and builds without any problems. However everytime I run
it in DEBUG and it comes to this line:

this.WebBrowser.Navigate("about:blank", ref flags, ref
targetFrame, ref postData, ref headers);
It throws this error:

System.OutOfMemoryException: Error creating window handle.
I am following this article here for instructions:

http://www.codeproject.com/csharp/ad...chostuihandler
Can anyone please advice how to get around this error; or if there is
an easier way to do this on .NET 1.1 (I need an embedded browser
control)?
Here is the stack-trace:

System.OutOfMemoryException: Error creating window handle. --->
System.NullReferenceException: Object reference not set to an instance
of an object.
at Program.Form1.Form1_Load(Object sender, EventArgs e) in c:
\program\form1.cs:line 92
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean
fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.IntCreate WindowEx(Int32
dwExStyle, String lpszClassName, String lpszWindowName, Int32 style,
Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent,
HandleRef hMenu, HandleRef hInst, Object pvParam)
at System.Windows.Forms.UnsafeNativeMethods.CreateWin dowEx(Int32
dwExStyle, String lpszClassName, String lpszWindowName, Int32 style,
Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent,
HandleRef hMenu, HandleRef hInst, Object pvParam)
at System.Windows.Forms.NativeWindow.CreateHandle(Cre ateParams cp)
--- End of inner exception stack trace ---
at System.Windows.Forms.NativeWindow.CreateHandle(Cre ateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Form.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Control.Show()
at Program.frmMain.mnuFileNew_Click(Object sender, EventArgs e) in
c:\program\frmmain.cs:line 312
Jul 19 '07 #2
Hi Nicholas,

Thanks for your reply. I was missing some key lines of code from the article
:)
"Nicholas Paldino [.NET/C# MVP]" wrote:
I'm just guessing here, but I think it has something to do with calling
Navigate before the window is shown (the Load event is fired before the
window is just shown. I seem to remember something similar when using the
object in VB6). Try setting a timer to fire right after the load event, and
then call navigate from there.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"R. K. Wijayaratne" <ra*****@gmail.comwrote in message
news:11**********************@z24g2000prh.googlegr oups.com...
Hi everyone,

I am trying to develop a Winforms app using .NET FW 1.1 (don't want to
use 2.0 for this particular project) and am trying to use the IE
control.
It compiles and builds without any problems. However everytime I run
it in DEBUG and it comes to this line:

this.WebBrowser.Navigate("about:blank", ref flags, ref
targetFrame, ref postData, ref headers);
It throws this error:

System.OutOfMemoryException: Error creating window handle.
I am following this article here for instructions:

http://www.codeproject.com/csharp/ad...chostuihandler
Can anyone please advice how to get around this error; or if there is
an easier way to do this on .NET 1.1 (I need an embedded browser
control)?
Here is the stack-trace:

System.OutOfMemoryException: Error creating window handle. --->
System.NullReferenceException: Object reference not set to an instance
of an object.
at Program.Form1.Form1_Load(Object sender, EventArgs e) in c:
\program\form1.cs:line 92
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean
fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.IntCreate WindowEx(Int32
dwExStyle, String lpszClassName, String lpszWindowName, Int32 style,
Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent,
HandleRef hMenu, HandleRef hInst, Object pvParam)
at System.Windows.Forms.UnsafeNativeMethods.CreateWin dowEx(Int32
dwExStyle, String lpszClassName, String lpszWindowName, Int32 style,
Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent,
HandleRef hMenu, HandleRef hInst, Object pvParam)
at System.Windows.Forms.NativeWindow.CreateHandle(Cre ateParams cp)
--- End of inner exception stack trace ---
at System.Windows.Forms.NativeWindow.CreateHandle(Cre ateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Form.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Control.Show()
at Program.frmMain.mnuFileNew_Click(Object sender, EventArgs e) in
c:\program\frmmain.cs:line 312
Jul 20 '07 #3

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

Similar topics

3
by: Z D | last post by:
Hello, I've created a winform user control that, at some point in the default constructor, looks for a specifc file. When I try to load the user control to my winform's form during design time...
8
by: Sunil Menon | last post by:
Dear All, We are developing applications in ASP.Net...in one of our applications we would like to use a GridControl...we have tried to use a Server-Side Grid control but found the speed to be an...
5
by: Drew | last post by:
I have a user control written in C#. This user control uses some of my mixed mode C++ libraries. My user control is currently residing on a .NET Windows Form. Everything works nicely. Now I am...
3
by: Eric | last post by:
If I have a windows form control declared in my aspx page: <OBJECT id="wcControl" classid="http:MyControl.dll#MyControls.wcControl" height="100%" width="100%" VIEWASTEXT> </OBJECT> Can I not...
3
by: EJ1003 | last post by:
Hello I would like to create Activex Control uisng C# and use it in ASP.Net webform. User Control is not solving my requirement so I am going for Activex Control. Please guide me on this, how...
4
by: Scott M. | last post by:
I need to be able to have a web form that users can enter (either by typing or pasting from a rich text format) text into. The entered text will then be saved as a new web page (.htm). The web...
1
by: Hercules Dev. | last post by:
hi all, I developed a winform control and succeeded in hosting it in my ASP.Net application, I used the default way which is installing my winform control in the same directory of my ASP.Net...
5
by: Giulio Petrucci | last post by:
Hello everybody, I'm quite new to .NET FW programming, and I started just few months ago, on FW2.0, knowing actually _nothing_ about FW1.1, so my question may sound silly... Anyway, what I...
3
by: Steve | last post by:
Hi All I am using VB.net 2008 and use timer controls within my applications Question Does the code in a Timer control.tick event run on a different thread to the main Application thread (UI...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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...
0
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,...

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.