SergioFeitoza Posted May 5, 2020 Posted May 5, 2020 Please help me with this “Connection error.” I will describe the sequence (Screens in the attached figure) I run my code successfully from inside Delphi. Everything works fine. (Screen1 ) Then I stop / close the code in the browser (Screen 2). The Delphi screen showing it is “running” . Then I do a “Program Rest” in Delphi (Screen 3) As everything is finished, I repeat all the sequence beginning by Delphi RUN (F9) again In many times (but not always) after I click the Login button in the Login page . (Screen 4) but instead of running well as before a message appear with “Connection Error”. It retries 3 times but unsuccessfully. (Screen 5) Note: before running again I cleaned the previous runnings (Screen 6) Questions: aa) Is it possible to include something in the beginning of the code to do the complete cleaning (Screen 6) automatically before running bb) Is it possible to also “ STOP RUNNING” Delphi when I close the browser (Screen 2)? c) What is the reason for the “Connection Error” (Screen 5) ? Memory ??? What could I try to do ? Quote
Sherzod Posted May 5, 2020 Posted May 5, 2020 3 hours ago, SergioFeitoza said: In many times (but not always) after I click the Login button in the Login page . Hello, Can you please explain in more detail? 3 hours ago, SergioFeitoza said: Then I stop / close the code in the browser (Screen 2). It is unclear, if you closed the tab, (closed the session or did you restart the session?), then how the login form remains open? Quote
SergioFeitoza Posted May 5, 2020 Author Posted May 5, 2020 Hi Sherzod. Thank you for the answer. I did nort explain well. When I say "Then I stop / close the code in the browser (Screen 2). " it means that I simply clicked the X tab to close the browser page (without any line of code). When I click the X in the tab the page close normally and browser is finished ( I think). Then I can see only Delphi (screen 3) . The login page did not remain opened. The Screen 3 that I included in the Figure is the new login page when I try to repeat all the operation again. Up to here everything worked fine as I need (execept that Delphi remained open and I had to go to RUN > Program Reset before restating the process. So here is one of the questions: I do not want that Delphi remains "running" when I close the page So , what should I include in the code to - when I click the X to close the tab - I also stop Delphi (as when I click Program Reset The more important question is. If everything worked fine in the first operation, why, when I try to repaet everything, just after, sometimes- but not always - get the “Connection Error” (Screen 5) ? Quote
SergioFeitoza Posted May 6, 2020 Author Posted May 6, 2020 Hi , here is additional information. I am noticing that the “Connection error” occurs also with other codes. Maybe I have some wrong configuration somewhere related to the server module. To try to solve step by step, please tell me what should I include in the code, before closing the execution, to delete these traces of the UniguiServer (see the new figure). If I run (and close) the program 5 times I get 5 times this. When there are many the code do not run (memory?) Quote
Administrators Farshad Mohajeri Posted May 6, 2020 Administrators Posted May 6, 2020 Hi, To close the app you normally need to right click on the icon and choose ShutDown from the menu. Quote
x11 Posted May 6, 2020 Posted May 6, 2020 - Use Buld events, Luke! Project/Options/Build/Buld events: taskkill /f /im $(OUTPUTFILENAME) /t Now, if you press Ctrl+Shift+F9, old process will be closed and start new version. Quote
SergioFeitoza Posted May 6, 2020 Author Posted May 6, 2020 Hi X11 This looks nice I will try and write after Thanks Quote
SergioFeitoza Posted May 7, 2020 Author Posted May 7, 2020 Hi. Based on the X11 comment I used code below. I am only interested in doing these things in "runtime" . It idoes more or less what I need. A question to you all Which code should I include in the code below which is equivalent to (Delphi vcl) : "click on RUN >> Program Reset" . I imagine that this is very easy but I do not know how to do .... the code to add below, in the Close event //////////////////////////////////////////// procedure TMainForm.CloseBUTClick(Sender: TObject); ( include ShellAPI in the USES clause) var Comando:string; begin Comando:= 'taskkill -im switchgeardesign.exe /f /t'; // Comando:= 'taskkill -im bds.exe /f /t'; ShellExecute(Handle, 'open', 'cmd.exe', PChar('/c'+Comando ), nil, 0); UniApplication.Terminate(' To close the application, just close the tab. To restart click below'); end; Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.