Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / June 2006

Tip: Looking for answers? Try searching our database.

VB 2005 Splash Screen Exception

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pbishop@hotmail.com - 20 Jun 2006 16:30 GMT
Hi,

I'm running VB 2005 express on Windows 2000, SP 4.  I have added a
splash screen to my project, which was running error-free until then.
The first time I run it each time I open the IDE, the splash screen
shows, then the main form shows, just as intended.  Each time after
that, I get an exception. If I compile it and run the exe, the first
time it runs as intended, and each time after it throws this exception.

System.Transactions Critical: 0 : <TraceRecord
xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord"
Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/
Exception/Unhandled</TraceIdentifier><Description>Unhandled

exception</Description><AppDomain>SI TreeView
1.vshost.exe</AppDomain><Exception><ExceptionType>System.NullReferenceException,
mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Object
reference not set to an instance of an object.</Message><StackTrace>
at System.Windows.Forms.Control.WaitForWaitHandle(WaitHandle
waitHandle)
  at System.Windows.Forms.Control.MarshaledInvoke(Control caller,
Delegate method, Object[] args, Boolean synchronous)
  at System.Windows.Forms.Control.Invoke(Delegate method, Object[]
args)
  at System.Windows.Forms.Control.Invoke(Delegate method)
  at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.HideSplashScreen()
  at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.MainFormLoadingDone(Object
sender, EventArgs e)
  at System.EventHandler.Invoke(Object sender, EventArgs e)
  at System.Windows.Forms.Form.OnLoad(EventArgs e)
  at System.Windows.Forms.Form.OnCreateControl()
  at System.Windows.Forms.Control.CreateControl(Boolean
fIgnoreVisible)
  at System.Windows.Forms.Control.CreateControl()
  at System.Windows.Forms.Control.WmShowWindow(Message&amp;amp; m)
  at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
  at System.Windows.Forms.ScrollableControl.WndProc(Message&amp;amp;
m)
  at System.Windows.Forms.ContainerControl.WndProc(Message&amp;amp; m)
  at System.Windows.Forms.Form.WmShowWindow(Message&amp;amp; m)
  at System.Windows.Forms.Form.WndProc(Message&amp;amp; m)
  at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp;
m)
  at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp;
m)
  at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
  at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd,
Int32 nCmdShow)
  at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
  at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
  at System.Windows.Forms.Control.set_Visible(Boolean value)
  at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
  at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context)
  at System.Windows.Forms.Application.Run(ApplicationContext context)
  at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
  at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
  at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[]
commandLine)
  at SI_TreeView_1.My.MyApplication.Main(String[] Args) in
17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
  at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
  at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
  at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
  at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
  at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
  at
System.Threading.ThreadHelper.ThreadStart()</StackTrace><ExceptionString>System.NullReferenceException:
Object reference not set to an instance of an object.
  at System.Windows.Forms.Control.WaitForWaitHandle(WaitHandle
waitHandle)
  at System.Windows.Forms.Control.MarshaledInvoke(Control caller,
Delegate method, Object[] args, Boolean synchronous)
  at System.Windows.Forms.Control.Invoke(Delegate method, Object[]
args)
  at System.Windows.Forms.Control.Invoke(Delegate method)
  at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.HideSplashScreen()
  at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.MainFormLoadingDone(Object
sender, EventArgs e)
  at System.EventHandler.Invoke(Object sender, EventArgs e)
  at System.Windows.Forms.Form.OnLoad(EventArgs e)
  at System.Windows.Forms.Form.OnCreateControl()
  at System.Windows.Forms.Control.CreateControl(Boolean
fIgnoreVisible)
  at System.Windows.Forms.Control.CreateControl()
  at System.Windows.Forms.Control.WmShowWindow(Message&amp;amp; m)
  at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
  at System.Windows.Forms.ScrollableControl.WndProc(Message&amp;amp;
m)
  at System.Windows.Forms.ContainerControl.WndProc(Message&amp;amp; m)
  at System.Windows.Forms.Form.WmShowWindow(Message&amp;amp; m)
  at System.Windows.Forms.Form.WndProc(Message&amp;amp; m)
  at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp;
m)
  at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp;
m)
  at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
  at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd,
Int32 nCmdShow)
  at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
  at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
  at System.Windows.Forms.Control.set_Visible(Boolean value)
  at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
  at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context)
  at System.Windows.Forms.Application.Run(ApplicationContext context)
  at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
  at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
  at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[]
commandLine)
  at SI_TreeView_1.My.MyApplication.Main(String[] Args) in
17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
  at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
  at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
  at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
  at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
  at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
  at
System.Threading.ThreadHelper.ThreadStart()</ExceptionString></Exception></TraceRecord>

I can't find the line of code that throws this error.  I wonder if the
code that throws the error is generated on the fly, seeing that the
file in the text of the exception has a randomly-generated name:
"17d14f5c-a337-4978-8281-53493378c1071.vb:line 81".  This is besides
the fact that I didn't write any code to use the splash screen or
customize it.

If I set the splash screen to "none" in the project properties, the
project runs without errors. If I set it back to use the splash screen,
I get the error.

In the project properties, I enabled the "Enable XP Visual Styles",
"Make Single Instance Application", "Save My.Settings on shutdown".
Authentication mode is "Windows", shutdown mode is "when startup form
closes", and SplashScreen is "Splashscreen1".

I have scoured the groups, msdn and the Web and haven't found anything
helpful.  Sometimes folks will customize their splashscreen and get
this exception, but then there is no answer.

I really need to use a splash screen in this app because the main form
has some processing to do before it displays.

Any help is much appreciated!

Peggy
pbishop@hotmail.com - 26 Jun 2006 21:25 GMT
As a follow-up to my post, I found this work-around posted on MSDN.
However, I still get the error message when I try it.
http://connect.microsoft.com/VisualStudio/feedback/Workaround.aspx?FeedbackID=114918

Has anyone been able to get it to work?  I'd be interested in the
details in how to make it work.

Thanks.

> Hi,
>
[quoted text clipped - 169 lines]
>
> Peggy
Philip Sheard - 27 Jun 2006 11:00 GMT
I have had users report the same problem, on Win2k systems. It seems that
the program looses the handle for the splash screen. I have come across
other posts about this.I suggest that you just scrap your splash screen
altogether. IMO it kicks in too late, anyway.

> As a follow-up to my post, I found this work-around posted on MSDN.
> However, I still get the error message when I try it.
[quoted text clipped - 178 lines]
>>
>> Peggy
pbishop@hotmail.com - 27 Jun 2006 19:41 GMT
Thanks, Philip.  That's what I ended up doing.  My "custom" splash
screen was pretty easy to make and works right.

> I have had users report the same problem, on Win2k systems. It seems that
> the program looses the handle for the splash screen. I have come across
[quoted text clipped - 183 lines]
> >>
> >> Peggy

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.