I try to display a splash screen at startup. The SplashScreen is a DevExpress component.
So that the SplashSreen is updated, I think it has to be started in a separate task.
Unfortunately I get this error:
Code: Select all
System.ArgumentNullException: Der Wert darf nicht NULL sein.
Parametername: start
bei System.Threading.Thread..ctor(ThreadStart start)
bei XApp.Start(__Usual[] Xs$Args) in F:VSVisual Studio 2017XSWinQuickDev20VOMDIApp1Start.prg:Zeile 21.
bei VOMDIApp.Exe.Functions.Start() in F:VSVisual Studio 2017XSWinQuickDev20VOMDIApp1Start.prg:Zeile 8.
My code is:
Code: Select all
USING System
USING System.Threading.Tasks
[STAThread];
FUNCTION Start() AS INT
LOCAL oXApp AS XApp
TRY
oXApp:=XApp{}
oXApp:Start()
CATCH oException AS Exception
ErrorDialog(oException)
END TRY
RETURN 0
CLASS XApp INHERIT App
METHOD Start()
LOCAL oMainWindow AS StandardShellWindow
local i AS DWORD
local thread1 as System.Threading.Thread
thread1:=System.Threading.Thread{XApp:ShowSreen()}
thread1:Start()
//Do Some Start routine
For I:=1 to 100
sleep(50)
NEXT
//how to close the SplashSreen Form? Kill the Task?
thread1:Abort()
oMainWindow:Show(SHOWCENTERED)
local Nw1 as Window1
Nw1:=Window1{oMainWindow}
Nw1:Show()
SELF:Exec()
RETURN NIL
Static method ShowSreen() as System.Threading.ThreadStart
Local sp as AuftragSQLKasseCSWinForms.SplashScreen1
sp:=AuftragSQLKasseCSWinForms.SplashScreen1{}
sp:Show()
return
END CLASS
VS2019 / X#2.4a
Regards, Frank