By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,215 Members | 1,930 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,215 IT Pros & Developers. It's quick & easy.

Getting "Error creating window handle." and don't know why

P: n/a
Hey guys,

Here is whats happening. I have a StringBuilder, a TextBox, and a
TabControl with one TabPage. On my main form, I created and displayed a
fairly big maze. While the app is solving the maze, it appends each step it
takes to the StringBuilder.

When the maze is solved, the user can click a menu item to display the
results. When the menu item is clicked, I set the TextBox Text value using
the StringBuilder's ToString() method and the TabControl, which starts with
Visible = false is displayed by setting Visible= true. That is the line that
causes this error:

_results.Visible = true; // _results is the TabControl

A first chance exception of type 'System.ComponentModel.Win32Exception'
occurred in system.windows.forms.dll

Additional information: Error creating window handle.

Now, I'm not sure what is causing this error. The TextBox is the only
control on the single existing TabPage and is set to Fill the page. Can it
be that there are too many lines in the TextBox? After solving the maze,
there are 18362 lines of text to be displayed. Is that a problem because
everyhting works fine when I am dealing with smaller mazes and fewer lines of
text.

Any help is greatly appreciated :)

P.S. The strange thing is that rarely it works fine even with a huge amount
of text.

Following is the call stack:
system.windows.forms.dll!System.Windows.Forms.Nati veWindow::CreateHandle(System.Windows.Forms.Create Params
cp = {System.Windows.Forms.CreateParams}) + 0x264 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::CreateHandle() +
0x19a bytes
system.windows.forms.dll!System.Windows.Forms.Text BoxBase::CreateHandle()
+ 0x30 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::CreateControl(bool
fIgnoreVisible = false) + 0xd4 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::CreateControl(bool
fIgnoreVisible = false) + 0x1b1 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::CreateControl() +
0x12 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::SetVisibleCore(bool
value = true) + 0x143 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::set_Visible(bool
value = true) + 0x1e bytes
system.windows.forms.dll!System.Windows.Forms.TabP age::set_Visible(bool
value = true) + 0x1c bytes
system.windows.forms.dll!System.Windows.Forms.TabC ontrol::UpdateTabSelection(bool uiselected = false) + 0xe1 bytes
system.windows.forms.dll!System.Windows.Forms.TabC ontrol::OnHandleCreated(System.EventArgs e = {System.EventArgs}) + 0x27d bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::WmCreate(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x7b bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x373 bytes
system.windows.forms.dll!System.Windows.Forms.TabC ontrol::WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x182 bytes
system.windows.forms.dll!ControlNativeWindow::OnMe ssage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x19 bytes
system.windows.forms.dll!ControlNativeWindow::WndP roc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes
system.windows.forms.dll!System.Windows.Forms.Nati veWindow::DebuggableCallback(__int32
hWnd = 3083886, __int32 msg = 1, __int32 wparam = 0, __int32 lparam =
1304468) + 0x39 bytes
system.windows.forms.dll!System.Windows.Forms.Unsa feNativeMethods::CreateWindowEx(__int32
dwExStyle = 0, String* lpszClassName = "WindowsForms10.SysTabControl32.app1",
String* lpszWindowName = null, __int32 style = 1442908162, __int32 x = 983,
__int32 y = 0, __int32 width = 224, __int32 height = 983, __int32 hWndParent
= 13830492, __int32 hMenu = 0, __int32 hInst = 4194304, System.Object pvParam
= null) + 0x3c bytes
system.windows.forms.dll!System.Windows.Forms.Nati veWindow::CreateHandle(System.Windows.Forms.Create Params
cp = {System.Windows.Forms.CreateParams}) + 0x1d6 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::CreateHandle() +
0x19a bytes
system.windows.forms.dll!System.Windows.Forms.TabC ontrol::CreateHandle() +
0x49 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::CreateControl(bool
fIgnoreVisible = false) + 0xd4 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::CreateControl() +
0x12 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::SetVisibleCore(bool
value = true) + 0x143 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::set_Visible(bool
value = true) + 0x1e bytes
FloorsTest.exe!FloorsTest.Maze._viewResults_Click (System.Object sender = {System.Windows.Forms.MenuItem}, System.EventArgs e = {System.EventArgs}) Line 707 C#

Mar 1 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I believe that TextBox has a 64K character limit. Try using RichTextBox, as
it does not have this limit.

"Flack" wrote:
Hey guys,

Here is whats happening. I have a StringBuilder, a TextBox, and a
TabControl with one TabPage. On my main form, I created and displayed a
fairly big maze. While the app is solving the maze, it appends each step it
takes to the StringBuilder.

When the maze is solved, the user can click a menu item to display the
results. When the menu item is clicked, I set the TextBox Text value using
the StringBuilder's ToString() method and the TabControl, which starts with
Visible = false is displayed by setting Visible= true. That is the line that
causes this error:

_results.Visible = true; // _results is the TabControl

A first chance exception of type 'System.ComponentModel.Win32Exception'
occurred in system.windows.forms.dll

Additional information: Error creating window handle.

Now, I'm not sure what is causing this error. The TextBox is the only
control on the single existing TabPage and is set to Fill the page. Can it
be that there are too many lines in the TextBox? After solving the maze,
there are 18362 lines of text to be displayed. Is that a problem because
everyhting works fine when I am dealing with smaller mazes and fewer lines of
text.

Any help is greatly appreciated :)

P.S. The strange thing is that rarely it works fine even with a huge amount
of text.

Following is the call stack:
system.windows.forms.dll!System.Windows.Forms.Nati veWindow::CreateHandle(System.Windows.Forms.Create Params
cp = {System.Windows.Forms.CreateParams}) + 0x264 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::CreateHandle() +
0x19a bytes
system.windows.forms.dll!System.Windows.Forms.Text BoxBase::CreateHandle()
+ 0x30 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::CreateControl(bool
fIgnoreVisible = false) + 0xd4 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::CreateControl(bool
fIgnoreVisible = false) + 0x1b1 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::CreateControl() +
0x12 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::SetVisibleCore(bool
value = true) + 0x143 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::set_Visible(bool
value = true) + 0x1e bytes
system.windows.forms.dll!System.Windows.Forms.TabP age::set_Visible(bool
value = true) + 0x1c bytes
system.windows.forms.dll!System.Windows.Forms.TabC ontrol::UpdateTabSelection(bool uiselected = false) + 0xe1 bytes
system.windows.forms.dll!System.Windows.Forms.TabC ontrol::OnHandleCreated(System.EventArgs e = {System.EventArgs}) + 0x27d bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::WmCreate(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x7b bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x373 bytes
system.windows.forms.dll!System.Windows.Forms.TabC ontrol::WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x182 bytes
system.windows.forms.dll!ControlNativeWindow::OnMe ssage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x19 bytes
system.windows.forms.dll!ControlNativeWindow::WndP roc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes
system.windows.forms.dll!System.Windows.Forms.Nati veWindow::DebuggableCallback(__int32
hWnd = 3083886, __int32 msg = 1, __int32 wparam = 0, __int32 lparam =
1304468) + 0x39 bytes
system.windows.forms.dll!System.Windows.Forms.Unsa feNativeMethods::CreateWindowEx(__int32
dwExStyle = 0, String* lpszClassName = "WindowsForms10.SysTabControl32.app1",
String* lpszWindowName = null, __int32 style = 1442908162, __int32 x = 983,
__int32 y = 0, __int32 width = 224, __int32 height = 983, __int32 hWndParent
= 13830492, __int32 hMenu = 0, __int32 hInst = 4194304, System.Object pvParam
= null) + 0x3c bytes
system.windows.forms.dll!System.Windows.Forms.Nati veWindow::CreateHandle(System.Windows.Forms.Create Params
cp = {System.Windows.Forms.CreateParams}) + 0x1d6 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::CreateHandle() +
0x19a bytes
system.windows.forms.dll!System.Windows.Forms.TabC ontrol::CreateHandle() +
0x49 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::CreateControl(bool
fIgnoreVisible = false) + 0xd4 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::CreateControl() +
0x12 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::SetVisibleCore(bool
value = true) + 0x143 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol::set_Visible(bool
value = true) + 0x1e bytes
FloorsTest.exe!FloorsTest.Maze._viewResults_Click (System.Object sender = {System.Windows.Forms.MenuItem}, System.EventArgs e = {System.EventArgs}) Line 707 C#

Mar 2 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.