471,355 Members | 1,646 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,355 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 2296
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Z D | last post: by
8 posts views Thread by Sunil Menon | last post: by
4 posts views Thread by Scott M. | last post: by
5 posts views Thread by Giulio Petrucci | last post: by
3 posts views Thread by Steve | last post: by

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.