Instanciation d'un thread
Bonjour à tous,
je m'inspire d'un tutoriel pour créer un splashscreen dans mon application et depuis un moment j'ai une erreur qui m'embête:
Citation:
Object reference not set to an instance of an object
au niveau de
Code:
ms_oThread.IsBackground = true;
dans la portion de code suivante:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
// Threading
static SplashScreen ms_frmSplash = null;
static Thread ms_oThread = null;
static public void ShowSplashScreen()
{
if (ms_frmSplash != null) return;
ms_oThread.IsBackground = true;
ms_oThread.SetApartmentState(ApartmentState.STA);
ms_oThread.Start();
} |