Jump to content

Ian Branch

Members
  • Content Count

    1252
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Ian Branch

  1. Hi Team, Is it safe/better to do this.. .... .... // IdSSLIOHandlerSocketOpenSSL1 := TIdSSLIOHandlerSocketOpenSSL.Create(Self); IdSMTP1 := TIdSMTP.Create(Self); IdMessage1 := TIdMessage.Create(Self); // .... .... ..... // IdSSLIOHandlerSocketOpenSSL1.Free; IdSMTP1.Free; IdMessage1.Free; // ... end; Or this.... .... .... // IdSSLIOHandlerSocketOpenSSL1 := TIdSSLIOHandlerSocketOpenSSL.Create(nil); IdSMTP1 := TIdSMTP.Create(nil); IdMessage1 := TIdMessage.Create(nil); // .... .... ..... // FreeAndNil(IdSSLIOHandlerSocketOpenSSL1); FreeAndNil(IdSMTP1); FreeAndNil(IdMessage1); // ... end; Or something else? Or doesn't it matter? Regards & TIA, Ian
  2. Ian Branch

    Creating and Freeing components on-the-fly..

    Hi Remy, Now hat's an interesting construct. IIUC, by using IdSMTP1 like that, when IdSMTP1 is Free'd it automatically frees IdSSLIOHandlerSocketOpenSSL1 & IdMessage1. Sneaky. Ian
  3. Ian Branch

    Possible D10.4.2 issue..

    Hi Team, For years, up to and including D10.4.1, I have been using the following in my App, and it has been running without issue via RDP on a Customer's Win 2012 R2 Server.. {Main Form code} procedure TMainForm.mnuRemovePartsClick(Sender: TObject); begin // TRemovePartsForm.Create(Self).ShowModal; // end; {code} and in RemovePartsForm I have this at Close.. {RemovePartsForm code} procedure TRemovePartsForm.FormClose(Sender: TObject; var Action: TCloseAction); begin dmS.DBC1.CloseDataSets; Action := caFree; end; {code} Closing RemovePartsForm takes me back to the Main Form. Rebuilding the App in D10.4.2, and running it on the Server, when the Close button is clicked and the form closes the App crashes to the OS effectively at the Action := caFree! 😞 It does not happen on my Dev Win 10 PC. I have a work around.. {Main Form code} procedure TMainForm.mnuRemovePartsClick(Sender: TObject); var RemovePartsForm: TRemovePartsForm; begin // RemovePartsForm := TRemovePartsForm.Create(Self); // try // RemovePartsForm.ShowModal; // finally RemovePartsForm.Free; end; // end; {code} and .... {RemovePartsForm code} procedure TRemovePartsForm.FormClose(Sender: TObject; var Action: TCloseAction); begin dmS.DBC1.CloseDataSets; end; {code} And it all works as it used to. Unless someone can enlighten me otherwise, I suspect an issue here.. Regards, Ian
  4. Ian Branch

    Creating and Freeing components on-the-fly..

    Dalija - Noted. I have just finished doing just that. FrOsT.Brutal - Noted.
  5. Ian Branch

    Creating and Freeing components on-the-fly..

    Ahh. Excellent. Thank you for the clarification.
  6. Ian Branch

    Possible D10.4.2 issue..

    Ahhhh Ha! Tks Francois. I have eliminated the caFree in the OnClose event. Regards, Ian
  7. Ian Branch

    Creating and Freeing components on-the-fly..

    Yes, I started with the components on the form but removed them in favour of creating on the fly and just got into the '1' habit. 🙂 Having said that, I take your point. I feel a global search and replace coming on. 🙂 I guess the main thrust of the question in my mind is should I use '.Free' or 'FreeAndNil(' or doesn't it matter, with .Create(nil)?? Ian
  8. Ian Branch

    Possible D10.4.2 issue..

    Hi emailx45, The Login form is generic across 18 Apps. In this piece of code.. if TLogInForm.Execute('DBiUsers', BinToInt('1')) then begin // I am passing parameters to the Login form that will indicate the App Name and the permission(s) the User needs for the respective App based on their role in the organisation. Regards, Ian
  9. Ian Branch

    Possible D10.4.2 issue..

    Hi Emailx45, Message received. :-) So here's a scenario.. In the project file I have the following.... ... ... begin // Application.Initialize; // UseLatestCommonDialogs := True; // // 7 6 5 4 3 2 1 0 // 1 // Bits 0 -> 1 = 1 if TLogInForm.Execute('DBiUsers', BinToInt('1')) then begin // Application.Title := 'DBiUsers Utility for DBWorkflow'; Application.MainFormOnTaskbar := True; Application.CreateForm(TMainForm, MainForm); Application.Run; // end; end. In the Loginform OnClose event I have the following... .... ..... public { Public declarations } class function Execute(const sApplication: string; const iBits: SmallInt): Boolean; end; .... .... implementation uses UsersData; {$R *.dfm} class function TLogInForm.Execute(const sApplication: string; const iBits: SmallInt): Boolean; begin // sApp := sApplication; iBitsSet := iBits; // with TLogInForm.Create(nil) do try Result := ShowModal = mrOk; finally Free; end; // end; .... .... ... procedure TLogInForm.FormClose(Sender: TObject; var Action: TCloseAction); begin // DBC1.CloseDataSets; // DBC1.Close; DBSLogin.Close; DBE1.Close; // Action := caFree; // end; Based on your description, Free; in the Execute procedure should be FreeAndNil? And the Action := caFree; in the OnClose removed. I'm guessing yes to both. Regards, Ian
  10. Ian Branch

    Possible D10.4.2 issue..

    Yes. I put a message in before and after the Action line. Got both but it never back to the main form where I had another message.
  11. Ian Branch

    Object Inspector issue in 10.4.2??

    All, Found it! It was caused by the Beta version of LMDs 2021 Tools. Eugene is now aware of it and has pointed to the 'switch' to turn it off, it will be taken care of in the release version of LMD Tools 2021. Thanks to all for your input, Ian
  12. Ian Branch

    Possible D10.4.2 issue..

    Hi Francois, The Server is a Win 2012 R2. My apologies, incomplete information. They have checked via RDP, on the Server PC itself, and on their Win7 & Win 10 workstations with the same result. Very frustrating. But, as I said, I can't make it happen here on my Win 10 Dev PC. I am giving up on it att until the update for 10.4.2 arrives and I will retry it then. I have spent two full days on it now and the Customer is rightly teed off. Restoring to 10.4.1 has placated him att. Ian
  13. Ian Branch

    Possible D10.4.2 issue..

    I have reverted back to 10.4.1, with the code reverted to pre 10.4.2. Same IDE Plug-ins, same libraries. All testing so far has not produced any crashes. Testing continues.
  14. Ian Branch

    Possible D10.4.2 issue..

    Hi Francois, It doesn't fail on my PC. Only when run via RDP at the Client's site on their Server. Just to totally verify, I am going back to 10.4.1 to test further. Ian
  15. Ian Branch

    Object Inspector issue in 10.4.2??

    Good Question. I honestly don't recall. The first time I noticed it was when I started working on my Apps which was after I had loaded my usual Experts & libraries. So. I just de-installed all my Experts, issue persisted. I am now de-installing my libraries to see if any of them are the culprit. We shall see...
  16. Ian Branch

    Object Inspector issue in 10.4.2??

    In my case it doesn't matter what the component, button, form, panel or grid, native or 3rd Party, they all do/show the issue for Boolean properties.
  17. Ian Branch

    Object Inspector issue in 10.4.2??

    Hi Team, 1. This issue is happening all the time in D10.4.2. 2. This did not happen to me in D10.4.1 3. I changed my scaling to 100%, same issue. 4. I changed my resolution from the my normal 3840 x 2160 to 1920 x 1080 @ 100%, same issue. Ian
  18. Ian Branch

    Manifest DPI Awareness settings??

    Hi Team, D10.4.2. Can somebody point me to a breakdown of the various setting for the DPI Awareness in the Delphi Manifest please? Settings for D10.4.1 should be OK/applicable. Regards & TIA,
  19. Ian Branch

    Object Inspector issue in 10.4.2??

    Hi Francois, It is always like that unless I click on the Property, then it shows correctly. Ian
  20. Hi David, Did you use the ISO or Web install? If the Web, did you simply run the 10.4.2 install with 10.4.1 still installed or did you de-install 10.4.1 first. Reason for the questions...I have become a little confused as to what exactly needs to be done with what.
  21. Ian Branch

    Delphi 10.4.2 first impressions

    Was that the Migration tool from 10.4.1??
  22. Hi Team, D10.4.1. I have the following code or equivalent in several places in a Unit and other apps. // if not FilterID1.Execute then dlgResult := False; // FilterValue := Trim(FilterID1.Value); // if FilterID1.Value.IsEmpty then dlgResult := False else dlgResult := True; // if dlgResult then begin if not TryStrToInt(FilterValue, iJobNo) then begin MessageBeep(MB_ICONERROR); showmessage('An Invalid Job # has been entered!'); end else break end else ApplyFilter := false; I keep getting the following warning.. Pointing to the " if not FilterID1.Execute then dlgResult := False;" Yet dlgResult is clearly used in the "if dlgResult then" test. Is this a bug or a "known issue"? If not, how do I get rid of the annoying warning? Aside from turning all H2077 warnings off. Regards & TIA, Ian
  23. Ian Branch

    "Value assigned to 'xxxxxxxx' never used" issue..

    Ahhhh. Thank you Remy. A little nuance I hadn't realised. 😞 Filed away for future reference. Your restructure of the code showed me that the was redundant. Regards & Thank you again for the assist. Ian
  24. Ian Branch

    GExperts 1.3.18 experimental twm 2021-02-21 released

    Built fine here for D2007 & D10.4.1.
×