472,354 Members | 2,224 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

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
1 8455
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: IMS.Rushikesh | last post by:
Hi Friends, My work is stuck up because of this unresolvable and unbelievable Error. I'm trying to Serialize my Class object using...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following...
3
by: Daylor | last post by:
hi. i want to destroy the application when i catch some exception. i have multithread app. how can i destroy the application and exit immedietly...
1
by: dipesh | last post by:
I am getting error when trying to Add Web Reference in Visual Studio 2005. "Some of the files required for web references are not installed"
1
by: chitara | last post by:
is there any posibility to block mysql port or someting? I am getting "Error ,query failed" during adding any data through the admin panel of that...
8
by: ipy2006 | last post by:
In my HTML I have, <input type="button" class="cartonsumkey" value="Sum Cartons" onclick="sumup(this);" /> In an external file that is called in...
5
by: Archana | last post by:
Hi all, I am having application where i am downloading xml content using webrequest. my code is as below HttpWebRequest lWebRequest =...
1
by: imranabdulaziz | last post by:
Dear All, I am using sql2005. i am writing stored procedure to save various master data . I recognize master by @type (input verible) and assign...
0
by: =?Utf-8?B?UmF2aQ==?= | last post by:
Hi, I have WCF service and integrated with STS (WS-Federation). The Service exposes 5 endpoints Win, UNT and Federated Windows, Federated UNT and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.