private static void ConnectToAcqClient() { try { acqClient = (IPnwAcqClient)Interaction.GetObject(null, "TCAcqClient.Server"); } catch (Exception) { acqClient = (IPnwAcqClient)Interaction.CreateObject("TcAcqClient.Server"); } }
public static void ConnectToAcqClient() { log.Debug("Initializing acqClient"); try { //_acqClient = (IPnwAcqClient)Interaction.GetObject(null, "TCAcqClient.Server"); _acqClient = (IPnwAcqClient)Marshal.GetActiveObject("TCAcqClient.Server"); log.Debug("Get TCAcqClient.Server"); } catch (Exception) { //_acqClient = (IPnwAcqClient)Interaction.CreateObject("TCAcqClient.Server"); _acqClient = (IPnwAcqClient)Activator.CreateInstance(Type.GetTypeFromProgID("TCAcqClient.Server")); log.Debug("Create TCAcqClient.Server"); } log.Info("Initialized TCAcqClient.Server"); log.Debug("Server Status=" + Enum.ToObject(typeof(PnwServerStateTypes), _acqClient.GetServerState())); }