Member Controls

Developers > 0.49 NativeWindow.CreateHandle Exception
jase439Link to postposted: Mon Sep 19, 2005 4:02 am

Member since:
 2005-03-16
Posts:
 93
I am receiving the following error quite often in 0.49 when line selecting various BHAVs using both v1 and v2 (using the 9-17 release from simlogical) of the BHAV plug-in. Pete mentions that he is also seeing this error with a fair degree of frequency as of late. Not sure if its due to a change in SimPE or the BHAV plugin, however I have discovered that line selecting ClothingBoothGlbals:0x2004 will trip this error everytime. I can't imagine why CreateHandle would fail unless something is allocating handles en-masse in a loop.

I'd post this to the QA forum, but I do not presently have access.

Any suggested work arounds would be helpful if there are any ideas worth trying as this is a blocking issue for me.

Message:
SimPE will shut down due to an unhadled Exception.

SimPE Version:
Classic (0.49.2086.27809).

Exception Stack:
System.ComponentModel.Win32Exception: Error creating window handle.
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Control.CreateGraphicsInternal()
at System.Windows.Forms.ThreadExceptionDialog..ctor(Exception t)
at System.Windows.Forms.ThreadExceptionDialog..ctor(Exception t)
at System.Windows.Forms.ThreadContext.OnThreadException(Exception t)
at System.Windows.Forms.Control.WndProcException(Exception e)
at System.Windows.Forms.ControlNativeWindow.OnThreadException(Exception e)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at SimPe.Form1.Main(String[] args) in c:\simpe\fullsimpe\simpe\form1.cs:line 2584

Source:

System.Windows.Forms

Execution Stack:
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Control.CreateGraphicsInternal()
at System.Windows.Forms.ThreadExceptionDialog..ctor(Exception t)
at System.Windows.Forms.ThreadExceptionDialog..ctor(Exception t)
at System.Windows.Forms.ThreadContext.OnThreadException(Exception t)
at System.Windows.Forms.Control.WndProcException(Exception e)
at System.Windows.Forms.ControlNativeWindow.OnThreadException(Exception e)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at SimPe.Form1.Main(String[] args) in c:\simpe\fullsimpe\simpe\form1.cs:line 2584
Inge JonesLink to postposted: Mon Sep 19, 2005 9:35 am
Avator for Inge Jones

Member since:
 2005-03-06
Posts:
 1899
I knew I'd seen it before somewhere: http://ambertation.de/simpeforum/viewtopic.php?t=1630
jase439Link to postposted: Mon Sep 19, 2005 10:33 pm

Member since:
 2005-03-16
Posts:
 93
I'll supplement this thread with the same information I provided over at your site, Inge.

This problem arises during construction of the plugin view tab and is most prevalent during the loading of large BHAV's where load times are longest. In my experiments, I have found that switching to the Packed File tab and allowing the BHAV to load fully *before* switching to the Plugin View circumvents the error. I find that when I do this, the BHAV Plugin View has already been constructed the view in the background (even though it is hidden), so that when I switch to it, the display is all ready to go.

Only when the Plugin View tab is visible and active does this exception arise. I may be wrong in this assumption, but it looks to me like the Plugin View is being constructed asynchronously using multiple threads. It is unclear to me what value this serves since the view is otherwise unusable during load. Perhaps there is a problem with asynchronous input processing (mouse movements, mouse activates, etc.) while that view is being constructed?

To reproduce the problem, load a modestly large package file, find 2 BHAV's of 30 or more nodes and simply flip between them a couple of times - waiting for each to fully load before switching to the other. I can bring SimPE down w/ this exception usually within 3 or 4 iterations of this procedure.

J

PS. FWIW, I did apply the .NET 1.1 service pack within the last month if that is at all relevant here. I am using a locally compiled version of SimPE, however.
pljonesLink to postposted: Tue Sep 20, 2005 9:44 am
Avator for pljones

Member since:
 2005-04-02
From:
 London, UK
Posts:
 610
"jase439" wrote:
SimPE Version:
Classic (0.49.2086.27809).

That surprised me -- I expected it to be the new UI. I get it in that, too.
jase439Link to postposted: Wed Sep 21, 2005 2:49 pm

Member since:
 2005-03-16
Posts:
 93
Well, you seem to have the leaky handle problem fixed. I hammered on the new PJSE plugin for 5 hours straight last night - lots and lots of BHAV look ups - without a single hiccup. Nice work.


viewthread, 0, 0, 049-NativeWindowCreateHandle-Exception