public OpcForm(OutProc anOutProc) { InitializeComponent(); dataControl1.Start(); try { m_outProc = anOutProc; m_opcClient = m_outProc.OpcClient; } catch (Exception exc) { MessageBox.Show(exc.ToString()); } // end try...catch } // end constructor
/// <summary> /// The main entry point for the application. /// </summary> static void Main() { OutProc outProc = new OutProc(); try{ outProc.CreateOpcClient(); OpcClient opcClient = outProc.OpcClient; OpcForm opcForm = new OpcForm(outProc); Application.Run(opcForm); opcClient = null; } catch (Exception exc) { MessageBox.Show(exc.ToString()); } // end try...catch } // end Main