From eecaea85f31f693fef735158f382ad6d9ccc4ece Mon Sep 17 00:00:00 2001 From: Digital Data - Marlon Schreiber Date: Thu, 4 Oct 2018 12:26:11 +0200 Subject: [PATCH] MS --- app/DD_PM_WINDREAM/ClassInit.vb | 1 + app/DD_PM_WINDREAM/ClassWindream_allgemein.vb | 36 ++++++++-------- app/DD_PM_WINDREAM/frmMain.vb | 43 ++++++++++++------- 3 files changed, 46 insertions(+), 34 deletions(-) diff --git a/app/DD_PM_WINDREAM/ClassInit.vb b/app/DD_PM_WINDREAM/ClassInit.vb index d2d1850..3ec451d 100644 --- a/app/DD_PM_WINDREAM/ClassInit.vb +++ b/app/DD_PM_WINDREAM/ClassInit.vb @@ -190,6 +190,7 @@ Public Class ClassInit Try WMSESSION_STARTSTOP_STARTUP = DT.Rows(0).Item("WMSESSION_STARTSTOP_STARTUP") Catch ex As Exception + ClassLogger.Add("Unexpected Error in Settings_LoadBasicConfig: " & ex.Message, True) WMSESSION_STARTSTOP_STARTUP = False End Try diff --git a/app/DD_PM_WINDREAM/ClassWindream_allgemein.vb b/app/DD_PM_WINDREAM/ClassWindream_allgemein.vb index 09a19bf..9879307 100644 --- a/app/DD_PM_WINDREAM/ClassWindream_allgemein.vb +++ b/app/DD_PM_WINDREAM/ClassWindream_allgemein.vb @@ -130,34 +130,34 @@ Public Class ClassWindream_allgemein End Function Public Function Start_WMCC_andCo() + Try + If WMSESSION_STARTSTOP_STARTUP = True Then + ClassLogger.Add(">> WINDREAM-Start on ApplicationStart is active!", False) - If WMSESSION_STARTSTOP_STARTUP = True Then - Try Dim owindreamControlCenter = CreateObject("Wmcc.ControlCenter") Dim owindreamIndexService = CreateObject("WMIndexServer.WMIdxSvControl") owindreamControlCenter.StartVFSService(1) + System.Threading.Thread.Sleep(1000) owindreamIndexService.Start() System.Threading.Thread.Sleep(1500) - Create_Session() - Catch ex As Exception - ClassLogger.Add("Error while starting up WMCC and IndexService: " & ex.Message, True) - End Try - - - End If + End If + Create_Session() + Catch ex As Exception + ClassLogger.Add("Error while starting up WMCC and IndexService: " & ex.Message, True) + End Try End Function Public Function Stop_WMCC_andCo() - If WMSESSION_STARTSTOP_STARTUP = True Then - Try + Try + If WMSESSION_STARTSTOP_STARTUP = True Then Dim owindreamControlCenter = CreateObject("Wmcc.ControlCenter") Dim owindreamIndexService = CreateObject("WMIndexServer.WMIdxSvControl") - owindreamControlCenter.StartVFSService(0) - owindreamIndexService.Shutdown() - owindreamControlCenter.ExitCC(0) - Catch ex As Exception - ClassLogger.Add("Error while Stopping WMCC and IndexService: " & ex.Message, True) - End Try - End If + owindreamControlCenter.StartVFSService(0) + owindreamIndexService.Shutdown() + owindreamControlCenter.ExitCC(0) + End If + Catch ex As Exception + ClassLogger.Add("Error while Stopping WMCC and IndexService: " & ex.Message, True) + End Try End Function #End Region diff --git a/app/DD_PM_WINDREAM/frmMain.vb b/app/DD_PM_WINDREAM/frmMain.vb index 3a9f597..461861c 100644 --- a/app/DD_PM_WINDREAM/frmMain.vb +++ b/app/DD_PM_WINDREAM/frmMain.vb @@ -24,7 +24,7 @@ Public Class frmMain Private GRID_INV_COL_REMOVED As Boolean = False Private _windream As New ClassWindream_allgemein - Private Sub frmProfiles_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing + Private Sub frmMain_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing Try ' Position und Größe speichern My.Settings.frmMainSize = Me.Size @@ -48,14 +48,14 @@ Public Class frmMain End Try End Sub - Private Sub frmProfiles_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp + Private Sub frmMain_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp Select Case e.KeyCode Case Keys.F12 frmLicense.ShowDialog() End Select End Sub - Private Sub frmProfiles_Load(sender As Object, e As System.EventArgs) Handles Me.Load + Private Sub frmMain_Load(sender As Object, e As System.EventArgs) Handles Me.Load If LogErrorsOnly = False Then ClassLogger.Add(" >> Initializing MainForm....", False) Try UserLookAndFeel.Default.SetSkinStyle("VS2010") @@ -120,23 +120,34 @@ Public Class frmMain Catch ex As Exception MsgBox("Fehler bei Laden des Formulars: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") End Try - If UniversalViewer = "" And Viewer = "uviewer" Then - MsgBox("Definieren Sie wo UniversalViewer abgelegt wurde!", MsgBoxStyle.Critical, "Fehlende Konfiguration") - frmKonfig.ShowDialog() - End If - If TimerRefresh.Enabled = False Then - TimerRefresh.Start() - End If + + Try + If UniversalViewer = "" And Viewer = "uviewer" Then + MsgBox("Definieren Sie wo UniversalViewer abgelegt wurde!", MsgBoxStyle.Critical, "Fehlende Konfiguration") + frmKonfig.ShowDialog() + End If + If TimerRefresh.Enabled = False Then + TimerRefresh.Start() + End If + Catch ex As Exception + MsgBox("Unexpected Error in LoadForm - Step 4: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:") + End Try + Load_Profile_items() Check_Timer_Notification() Restore_Form_Position() - _windreamPM = New ClassPMWindream - _windreamPM.Start_WMCC_andCo() - If _windreamPM.oSession.aLoggedin = False Then - MsgBox("Login on windream was not possible. Please check the log." & vbNewLine & "Application will close now!", MsgBoxStyle.Critical) - Me.Close() - End If + Try + _windreamPM = New ClassPMWindream + _windreamPM.Start_WMCC_andCo() + If _windreamPM.oSession.aLoggedin = False Then + MsgBox("Login on windream was not possible. Please check the log." & vbNewLine & "Application will close now!", MsgBoxStyle.Critical) + Me.Close() + End If + Catch ex As Exception + MsgBox("Unexpected Error in windream-login - Step 5: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:") + End Try + If LogErrorsOnly = False Then ClassLogger.Add(" >> MainForm initialized!", False) End If