Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to use WPF SplashScreen class under .NET Framework 4.5 / Windows 8?

$
0
0
Hi,

I have a problem using the WPF SplashScreen class under Windows 8:
When shutting down the application while the splash screen is about to be displayed, the program crashes sporadically with the following call stack:
ChildEBP RetAddr  
010af7c8 749eeaeb KERNELBASE!RaiseException+0x6c
010af7e4 74acb6e4 clr!COMPlusThrowBoot+0x1a
010af7f0 747d2823 clr!UMThunkStubRareDisableWorker+0x25
010af818 751d77d8 clr!UMThunkStubRareDisable+0x9
010af844 751d78cb USER32!InternalCallWinProc+0x23
010af8c0 751d7b6f USER32!UserCallWinProcCheckWow+0x100
010af924 751d7c44 USER32!DispatchClientMessage+0x15d
010af960 77962f02 USER32!__fnDWORD+0x2b
010af974 018541a0 ntdll!KiUserCallbackDispatcher+0x2e
WARNING: Frame IP not in any known module. Following frames may be wrong.
010af9c8 7693ddf8 0x18541a0
010afa18 7693e02a combase!CCliModalLoop::MyPeekMessage+0x5f [d:\win8_gdr\com\combase\dcomrem\callctrl.cxx @ 2316]
010afa8c 7693e0ca combase!CCliModalLoop::HandleWakeForMsg+0x15a [d:\win8_gdr\com\combase\dcomrem\callctrl.cxx @ 1954]
010afadc 76938d8d combase!CCliModalLoop::BlockFn+0x25b [d:\win8_gdr\com\combase\dcomrem\callctrl.cxx @ 1618]
010afb88 76938c23 combase!ClassicSTAThreadWaitForHandles+0xd7 [d:\win8_gdr\com\combase\dcomrem\classicsta.cpp @ 46]
010afbb0 748b3e82 combase!CoWaitForMultipleHandles+0xa4 [d:\win8_gdr\com\combase\dcomrem\sync.cxx @ 120]
010afc08 748b3e27 clr!MsgWaitHelper+0x64
010afc94 7494e825 clr!Thread::DoAppropriateWaitWorker+0x224
010afd00 7494e984 clr!Thread::DoAppropriateWait+0x64
010afd4c 74852f14 clr!CLREventBase::WaitEx+0x128
010afd64 749823f0 clr!CLREventBase::Wait+0x1a
010afde0 7498243d clr!IsRuntimeStarted+0xab
010afdec 749825e4 clr!WaitForEndOfShutdown+0x1b
010afe30 74945611 clr!EEShutDown+0xd1
010afe3c 7494566e clr!DisableRuntime+0x118
010afe50 74921fc2 clr!EEPolicy::HandleExitProcess+0x50
010afe90 74924162 clr!_CorExeMainInternal+0x1b1
010afecc 74e7f5a3 clr!_CorExeMain+0x4d
010aff04 74ef7efd mscoreei!_CorExeMain+0x10a
010aff1c 74ef4de3 MSCOREE!ShellShim__CorExeMain+0x7d
010aff24 74ff8543 MSCOREE!_CorExeMain_Exported+0x8
010aff30 7797ac69 KERNEL32!BaseThreadInitThunk+0xe
010aff74 7797ac3c ntdll!__RtlUserThreadStart+0x72
010aff8c 00000000 ntdll!_RtlUserThreadStart+0x1b
The crash does not happen all the time, only every now and then.

Here a simple example program to reproduce the problem:

App.xaml.cs file:
using System;
using System.Threading;
using System.Windows;

namespace SplashScreenTest
{
    public partial class App : Application
    {
        private void App_Startup(object sender, StartupEventArgs e)
        {
            SplashScreen splash = new SplashScreen("Splash.png");
            splash.Show(false);

            Thread.Sleep(1000);

            splash.Close(new TimeSpan(0,0,0,3));
            this.Shutdown();
        }
    }
}

App.xaml file:
<Application x:Class="SplashScreenTest.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             Startup="App_Startup"><Application.Resources></Application.Resources></Application>

You can use any PNG file as Splash.png.

Is there anything wrong in the way I am using the SplashScreen class?

(Please note: the crash does not happen if the timespan is reduced to zero; this can be used as a workaround. But still, a crash should not happen with a non-zero timespan.)

Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>