none
Invoke or BeginInvoke cannot be called on a control until the window handle has been created. RRS feed

  • Frage

  • Hallo Forum

    Hallo Forum

    Einige User melden, dass beim Starten einer Windows-Applikation eine Fehlermeldung erscheint:
    Unhandled excepion has occurred... (Details siehe ganz unten).

    Der Fehler tritt nur beim ersten Mal starten nach einem PC-Neustart auf. Die Appl. muss dann beendet werden (teilweise nur mit dem Taskmanager möglich). Jedes weitere Mal starten funktioniert danach.
    Es ist auch keine Regelmässigkeit feststellbar. Bei einige User häufiger, andere selten. Ich kann es in der Entwicklungsumgebung jedoch nicht nachvollziehen.

    Was ich inzwischen (mit Hilfe einer Log-Datei) herausgefunden habe: der Startvorgang hängt beim Laden vom MDI-Form

    log_zeile_1: MyApplication_Startup_start
    log_zeile_2: SplashScreenEFS_Load_start
    log_zeile_3: SplashScreenEFS_Load_ende
    log_zeile_4: MyApplication_Startup_ende
    log_zeile_5: frmMdi_Load_start
    log_zeile_6: frmMdi_Load_ende

    -> (hier dazwischen kommt die unhandled exception) <-

    log_zeile_7: frmMdi_Shown_start
    log_zeile_8: frmMdi_Shown_ende

    Im Fehler-Fall wird nur bis Zeile 6 ins LogFile geschrieben. Im Normalfall läuft es bis zur Zeile 8 durch.

    Die Applikation (in VB.NET) wurde ins VS-2010 migriert und für Framework-4 kompiliert. Die Clients laufen mit win-7 Enterprise SP1 (x64). Zuvor lief es problemlos mit VS-2005 Framework-2 auf win-XP.


    Vielen Dank für Tips und Hinweise
    Markus Baur


    ************** Exception Text **************
    System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
       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& m)
      at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    Montag, 10. Dezember 2012 13:44

Alle Antworten