Hi Steve,
From your description, the issue might be caused by the Devexpress.dll.
Also I think the application’s UI thread is frozen when the screensaver
starts. To make sure whether the UI thread is frozen, please use a
Threading.Timer to write some logs instead of calling the
Windows.Forms.Timer, because if the UI thread is hang, a
Windows.Forms.Timer cannot work either. To troubleshoot the root cause of
the issue, we can also use Process Explorer to check the callstack of the
UI thread. Here is some references:
http://www.technochakra.com/profiling-with-procexp-process-explorer/.
For the two follow up questions:
Question 1: We don’t need to destroy the thread manually after it
finishes running the thread proc. After the thread callback finishes, the
thread is ended. CLR will help us to destroy the stopped thread. Here
is a very helpful series articles introducing .NET threading,
http://www.albahari.com/threading/.
Question 2: If the form’s constructor has some other code logic that you
need to call when the application starts, I think your method to create the
forms is fine. Otherwise, if you only need to preload the assemblies into
AppDomain, I think directly calling Assembly.Load is more efficiency.
Also it will load the dependencies as well. However, please note that CLR
has optimize the assembly loading process and if the dependency assemblies
are not invoked, these assemblies will be delay loaded (be loaded if
necessary). So to make sure all the dependency assemblies are also
loaded, we can use the following code logic:
============================================
Dim ass As Assembly = Assembly.Load("AssemlyName")
Dim assName = ass.GetReferencedAssemblies()
For Each a In assName
Assembly.Load(a)
Next
============================================
Besides, here are some references about the differences among
Assembly.Load, Assembly.LoadFrom, and Assembly.LoadFile:
http://blogs.msdn.com/suzcook/archive/2003/05/29/57143.aspx
http://blogs.msdn.com/suzcook/archive/2003/09/19/57248.aspx
http://blogs.msdn.com/suzcook/archive/2003/06/13/57180.aspx
Have a nice day, Steve!
Best Regards,
Lingzhi Sun
Microsoft Online Community Support
=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================