static void Main(string[] args) { try { if (args.Length >= 1) { string fileName = args[0]; if (args.Length >= 2 && args[1].StartsWith("-pid ")) { EditorServer.SendFileNameToServer(fileName, args[1].Substring(5)); } else { EditorServer.SendFileNameToServer(fileName); } } else { EditorServer server = new EditorServer(); } } catch (Exception e) { MessageBox.Show( e.ToString(), "Exception in QtAppWrapper", MessageBoxButtons.OK, MessageBoxIcon.Error); } }