protected override void OnStart(string[] args) { try { Debug.Print("Starting"); try { EventLog.WriteEntry("Service starting"); } catch { Debug.Print("Writing to the event log is failing"); } needsShutdown = new ManualResetEvent(false); base.OnStart(args); hiddenform = new HiddenForm(); new Thread(RunMessagePump, 1024 * 256).Start(); hiddenform.started.WaitOne(); starting = false; running = false; OnNeedsReset(); } catch (Exception e) { Debug.Print("Exception :" + e.ToString()); try { EventLog.WriteEntry("Exception :" + e.ToString()); } catch {} } }
protected override void OnStart(string[] args) { try { Debug.Print("Starting"); try { EventLog.WriteEntry("Service starting"); } catch { Debug.Print("Writing to the event log is failing"); } needsShutdown = new ManualResetEvent(false); base.OnStart(args); hiddenform = new HiddenForm(); new Thread(RunMessagePump, 1024*256).Start(); hiddenform.started.WaitOne(); starting = false; running = false; OnNeedsReset(); } catch (Exception e) { Debug.Print("Exception :" + e.ToString()); try { EventLog.WriteEntry("Exception :"+e.ToString()); } catch{} } }