Your Products have been synced, click here to refresh
i some how ended up back on this page, in the method "StartPCDMIS()", I noticed that i should have used a different command to check when PC-DMIS is ready... so here's the Edit:
bool StartPCDMIS() { try { Type pcdObjType = Type.GetTypeFromProgID("PCDLRN.Application"); this.pcdApp = Activator.CreateInstance(pcdObjType); int timeout = 100; // the number of seconds to wait... pcdApp.WaitUntilReady(timeout); return true; //pc-dmis started } catch { return false; // an error occured } }
try { Type pcdObjType = Type.GetTypeFromProgID("PCDLRN.Application"); PCDApp = Activator.CreateInstance(pcdObjType); string status = ""; /* this while loop starts with status = "", and will query PC-DMIS for the text in the status bar at the bottom of the screen. when it finally says "READY" or it contains "DONE INIT", the loop will exit readystr and initstr is defined in the application settings */ while (status != readystr && !status.Contains(initstr)) { System.Threading.Thread.Sleep(1000); // give pc-dmis a second to work status = PCDApp.StatusBar(); } PCDStarted = true; //PC-DMIS started } catch //catch (System.Runtime.InteropServices.COMException f) { PCDStarted = false; // PC-DMIS did not start //MessageBox.Show(string.Format("PC-DMIS måste vara startat: {0}", f.Message)); // PC-DMIS needs to be started! //System.Windows.Forms.Application.Exit(); // Exit }
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |