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

Windows stations, desktops, and Winforms

P: n/a
From a parent process, I created a custom windows station and desktop.
I then CreateProcess using that
new station/desktop. There are no problems launching a plain windows
app with this station/desktop.
(I tried some simple apps and notepad.exe) However a Winforms app
If I use the default station (Winsta0) but a custom desktop, the
Winforms app does work.
I would prefer using a custom windows station, but I'm close to
punting :(

Winforms fails this way...

System.TypeInitializationException: The type initializer for
"System.Drawing.SafeNativeMethods" threw an exception. --->
System.Runtime.InteropServices.ExternalException: Failed to create
system events window thread.
at Microsoft.Win32.SystemEvents.EnsureSystemEvents(Bo olean
requireHandle, Boolean throwOnRefusal)
at Microsoft.Win32.SystemEvents.InvokeOnEventsThread( Delegate
at System.Drawing.SafeNativeMethods.Initialize()
at System.Drawing.SafeNativeMethods..cctor()
--- End of inner exception stack trace ---
at System.Drawing.SafeNativeMethods.CreateIconFromRes ourceEx(Byte*
pbIconBits, Int32 cbIconBits, Boolean fIcon, Int32 dwVersion, Int32
csDesired, Int32 cyDesired, Int32 flags)
at System.Drawing.Icon.Initialize(Int32 width, Int32 height)
at System.Drawing.Icon..ctor(Type type, String resource)
at System.Windows.Forms.Form.get_DefaultIcon()
at System.Windows.Forms.Form.get_Icon()
at System.Windows.Forms.Form.UpdateWindowIcon(Boolean redrawFrame)
at System.Windows.Forms.Form.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Control.SetVisibleCore(Boolea n value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Control.Show()
at com.tonic.tde.ui.TDE.Main(String[] args) in
c:\trunk\src\tonic\tde_client\cs\com\tonic\ui\tde. cs:line 525

The ExternalException's HRESULT is E_FAIL (which doesn't tell us

Has anyone seen this problem?
Nov 16 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.