Ian Branch
Members-
Content Count
1352 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Ian Branch
-
Hi Sherlock, Yes I did go back to that and I am just as confused now as I was then. I have the closing actions on the OnCloseQuery event. Under normal circumstances it works fine, but when the User shuts down their PC while the App is running/open it doesn't. The following is my OnCloseQuery.. procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean); var TS: TTimeSpan; StartDateTime, FinishDateTime: TDateTime; lUsersLogWritten: Boolean; begin // if GetSystemMetrics (SM_SHUTTINGDOWN) > 0 then iTerminateAction := 3; // app is being closed by a system shutdown // {$IF Defined(ELogging) or Defined(Codesite)} LogMessage('iTerminateAction = '+IntToStr(iTerminateAction)); {$ENDIF} // lUsersLogWritten := False; // LTI1.ShowBalloonHint('Closing Workflow Database...', 'Any Open Edits and/or Inserts are being cancelled and the Database closed.'); // if dmC.DBC1.Connected then begin // {$IF Defined(ELogging) or Defined(Codesite)} LogMessage('DBC1 is connected att.'); {$ENDIF} // CancelEditsInsertsInDatamodules; CancelEditsInsertsInOpenForms; end; // CloseOpenForms; // dmC.DBC1.CloseDataSets; // dmC.UsersLog.IndexName := 'SessionKey'; dmC.UsersLog.Open; // if dmC.UsersLog.FindKey([sSessionKey]) then begin dmC.UsersLog.Edit; // case iTerminateAction of 0: dmC.UsersLog.FieldByName('Action').AsString := 'Logged Out'; 1: dmC.UsersLog.FieldByName('Action').AsString := 'Timed Out'; 2: dmC.UsersLog.FieldByName('Action').AsString := 'Browser Closed'; 3: dmC.UsersLog.FieldByName('Action').AsString := 'System Shutdown'; end; // dmC.UsersLog.FieldByName('FinishDateTime').AsDateTime := now; StartDateTime := dmC.UsersLog.FieldByName('StartDateTime').AsDateTime; FinishDateTime := dmC.UsersLog.FieldByName('FinishDateTime').AsDateTime; TS := TTimeSpan.Subtract(FinishDateTime, StartDateTime); dmC.UsersLog.FieldByName('Duration').AsString := Format('%.3d:%.2d:%.2d:%.2d', [TS.Days, TS.Hours, TS.Minutes, TS.Seconds]); dmC.UsersLog.Post; // lUsersLogWritten := True; // end; // dmC.UsersLog.Close; // DBWReg.WriteString('Session Key', 'DBiWorkflow', ''); // dmC.DBC1.Close; dmC.DBS1.Close; dmC.DBE1.Close; // if iTerminateAction = 0 then begin // if not lUsersLogWritten then TaskMessageDlg('Workflow Closing error!', 'Note:- The Users Log was NOT updated. Workflow will now close..', mtError, [mbOK], 0); // end; // end; It doesn't work on my Win 11 PC. Happy to have the error of my ways pointed out. Regards, Ian
-
Thanks Guys, Angus - I will have a look at the component. Peter - In FormCloseQuery, how can I tell if it was triggered by WM_QUERYENDSESSION ? Regards, Ian
-
Hi Team, I am advised, although I take it with a grain of salt, that they shut down the PC rather than just turn it off. Angus, what is the component you use please? Ian
-
Hi Team, Win 11, D11.2, Indy as it came with D11.2. I am trying to receive emails from GMail so I can process them. I have the following code.. ..... with POP3 do begin Host := 'pop.gmail.com'; Username := 'MyUserName@gmail.com'; Password := 'MyPassword'; Port := 995; IOHandler := IdSSLIOHandlerSocketOpenSSL; UseTLS := utUseImplicitTLS; end; with IdSSLIOHandlerSocketOpenSSL do begin Destination := 'pop.gmail.com:995'; SSLOptions.SSLVersions := [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2]; Host := 'pop.gmail.com'; Port := 995; DefaultPort := 0; end; POP3.Connect; .... When run and it attempts to connect I get an error. "Username and password not accepted." I have verified and even reset my gmail password to no avail. I am clearly missing something, or is it a GMail thing.... Thoughts, suggestions, education appreciated. Regards & TIA, Ian
-
Would I be correct in assuming that the same thing applies to IMAP??
-
Tks rvk. What a PITA.
-
Would it be possible for the Expert Manager to change the order of loading of Experts? I ask this in the suspicion that the order of loading will dictate which Expert functionality/hotkey will have priority. Ian
-
Thank you. Appreciated. Ian
-
Hi Team, I just ran up against the limit of TTimer in 32bit. 4,294,967,295. 😞 I need to 'TTimer' to 15,000,000,000. Why 15,000,000,000? Because the Timer is being used to set an 8hour limit on the operation of an App. No, I can't go to 64bit. The Customer only has 32bit OS. 😞 Thoughts, suggestions appreciated. Regards & TIA, Ian
-
Hi Team, D11.1, latest GExperts, Win 11. Sometimes the Ctrl-Alt-F hot key sequence calls the Delphi DebugFPUCommand, and other times it does what I want, calls the GExpertsToolsEditorExportCodeFormatter. What dictates which will be called and when?? Regards, Ian
-
GExperts 'IDE Menu Shortcuts' allowed me to remove the Delphi Ctrl-Alt-F function so only the GExperts Ctrl-Alt-F is valid now. All good.
-
So. Also related to an earlier Ctrl-Alt-F issue.. GExperts 'IDE Menu Shortcuts' allowed me to remove the Delphi Ctrl-Alt-F function so only the GExperts Ctrl-Alt-F is valid now. All good.
-
Updated from 11.1 to 11.2 using the on-line installer. It deinstalled 11.1 OK but when it went to start to install 11.2 it kept falling over giving an error about loading Parnassus Bookmarks. I deleted the Bookmarks registry entry at Computer\HKEY_CURRENT_USER\Software\Embarcadero\BDS\22.0\Experts and the install worked. I reinstalled the GetIt stuff and am back in business. 🙂
-
OK. I have resolved this issue by hard coding an 8 hour time limit. The App is a Dashboard that is displayed on a screen at the start of the day. No user interaction required. At the start of the App I note the date/Time. There is a 60 second timer in the App doing something else. I put a test at the start of the Timer's event to test " if MinutesBetween(Now, dtStartDateTime) >= 480 then Close;" That should resolve what I believe is the underlying IdleTimer issue. The App resides on a Win 2012 Server. It is accessed and displayed in a Browser via the Web using Cybele's ThinFinity. I suspect that something in the Browser-ThinFinity-Server sequence is causing the App and therefore the IdleTimer to believe that something, either a keyboard or mouse, action has occurred, thus resetting the IdleTimer.
-
OK. Just to put your minds at ease. 1. I am getting too old for this stuff...... 2. The TTimer is only running to 60 secs, then it increments a minutes counter until the minutes counter reaches the Idle Minutes limit. So. It's not the timer, something else must be keeping the App 'Alive' even though the User isn't actually doing anything. Back to the drawing board.
-
OK. I have got myself confused here. 😞 8 hours = 480 minutes = 28,800 secs = 28,800,000 microsecs. (interval) Hmmm. Then the TTimer should be handling it correctly with a limit of 4,294,967,295. OK. I need to look elsewhere to find out why it isn't working at 8 hours. Thank you all for your contributions, Apologies for any inconvenience. Ian P.S. I just checked the actual in-App setting. Yes, I had 480 minutes.
-
So I was jus coming back to add that the TTimer is in an App Idle component. It is a slightly modified version of the unit in ccLib by David Cornelius on GitHub. It looks for keyboard and/or mouse activity and if it doesn't see any for the time out period, 8 hours (240min), then it closes the App.
-
Hi Mike, Thanks for the suggestion, I will see if that is practical. The TTimer functionality is within an Idle Timeout component, I don't really want to mess with the internals if I can avoid it. Ian
-
Thanks Thomas, Tried moving GExperts up the 'tree' didn't seem to change what I am experiencing. 😞 It does seem to be related to where the cursor is in the source code. For example, If I have the cursor in the Uses area it formats. If the cursor is in the Type area it pulls the Debug dialog. If I move the cursor down to support code/functions, it formats. If I move the cursor to the TMainForm.Function/Procedure code area, it pulls the Debug window. Sigh! 😉 Regards, Ian
-
No, sorry. My Customer uses a simple Win 2012 Server.
-
Hi Keesver, Tks. I haven't had anything like that reported to me. I would be interested though in the findings/solution. Regards, Ian
-
Hi Team, A Customer has asked about sending SMS messages from their Delphi App. I found the following code by Remy. var lHTTP: TIdHTTP; lParamList: TStringList; lResult: String; IdSSL : TIdSSLIOHandlerSocketOpenSSL; begin lParamList := TStringList.Create; try lParamList.Add('user=****'); lParamList.Add('password=****' ); lParamList.Add('message=Hello World'); lParamList.Add('sender=TestAccount'); lParamList.Add('mobile=+9195....'); lParamList.Add('type=1'); // or 3 lHTTP := TIdHTTP.Create(nil); try // note: if you are using an up-to-date version of Indy, // assigning the IOHandler is optional: // // http://www.indyproject.org/sockets/blogs/ChangeLog/20141222.aspx // lHTTP.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(lHTTP); try lResult := lHTTP.Post('https://www.bulksmsgateway.in/sendmessage.php', lParamList); // WriteLn(lResult); // Readln; except on E: Exception do begin //WriteLn('Error: ', e.Message); end; end; finally FreeAndNil(lHTTP); end; finally FreeAndNil(lParamList); end; end; Is it still valid? Regards & TIA, Ian
-
Ahhh Ha! Thanks Remy. I figured it had to be something like that but I don't know enough about Indy and this type of thing.. :-( All good now. Appreciated. Regards, Ian
-
Hi Remy, Thank you. I should have mentioned D11.1.1 with the GetIt Indy. I am using the v 1.0.2u libraries. I cannot see how/where to set the 'SSLOptions.SSLVersions := [sslvTLSv1_1, sslvTLSv1_2];'.. To me the logical place would be into IdSSL i.e. 'IdSSL.SSLOptions.SSLVersions := [sslvTLSv1_1, sslvTLSv1_2];', however it doesn't appear to be being used anywhere. Regards, Ian
-
@Keesver What issues are you experiencing with VirtualUI? I presume you mean ThinFinity?? My Customer has been using it on a Win 2012 Server for years with only initial teething issues. Ian