Jump to content

aehimself

Members
  • Content Count

    1096
  • Joined

  • Last visited

  • Days Won

    24

Everything posted by aehimself

  1. At work most of my colleagues prefer SourceTree. I find the UI sluggish and hard to complete simple tasks. I personally prefer VS Code's implementation (having it installed as the default text editor on all of my PCs might be a bias-factor, though). For me, Git handling is really easy, fast and easy to understand. As others already pointed out it's all a matter of taste. Some of my colleagues are still starting up Visual Studio for a simple pull, so... 🙂
  2. aehimself

    New annoying IDE malfunction

    There is that little beauty! I was not aware that we have a user fly-out menu until now:
  3. aehimself

    New annoying IDE malfunction

    There is an ignore list on this forum?! Where? I never seen it!
  4. I have a project, with multiple source files added from other projects. For a while now I switched from TRTLCriticalSection to TMonitor as it requires no additional unit imports and should be more cross-platform (?) than the prior. Now; most of the said imported files are using TMonitors the usual way: TMonitor.Enter(Self); Try // Do stuff Finally TMonitor.Exit(Self); End; Works like a charm. I added a new VCL form and a private worker thread implementation. In this new unit, I can not use TMonitor.Enter as the compiler says the method does not exist! Ctrl-clicking on TMonitor in the working and the non-working source file both redirects me to the same TMonitor implementation; System.pas:817. Hovering the mouse shows the same tooltip - record, declared in System.pas. Which is even more strange, the project can not even be compiled if I leave the underlined TMonitor calls in this one source file so I suspect it's not only LSP. At the moment I changed TMonitors to TCriticalSections in this file and it is working fine this way. Has anyone seen this issue so far? Any tips how I can make it to work?
  5. aehimself

    Delphi 10.4 compiler going senile

    We have a winner. The only thing which bugs me now, if I look up the class declaration, why it redirects me to System.TMonitor in this case...? This is why I did not even think about a different class with the same name in a different unit.
  6. aehimself

    Problem closing forms..

    I swear I had "random" access violations when an application was closed which was caused by freeing something owned by the form... then, when the form was closed it tried to free it again. Now, on Delphi 10.4 I simply can NOT reproduce the issue, no matter how hard I try. Checking the destructor code of TComponent: destructor TComponent.Destroy; begin Destroying; RemoveFreeNotifications; DestroyComponents; if FOwner <> nil then FOwner.RemoveComponent(Self); // THIS LINE FObservers.Free; inherited Destroy; end; Was THIS LINE always there? If I'm not mistaken the bug mentioned happened on Delphi 10 Seattle, before we made the upgrade... is it possible that it was implemented inbetween? If not, how exactly it can be reproduced?! Parents of mentioned components were frames, if it makes any difference
  7. ConvertToUTF8.7z Using the ZIP2 component (but unit can be renamed to Zip to use the Delphi default) for creating backup copies. Finished 3000+ files in 90 seconds in our project at work. It checks for BOM existence; so if you have actual UTF8 files without BOM it can cause issues.
  8. aehimself

    Problem closing forms..

    You are creating the form with the owner of your main form. When you close your main form therefore (as it owns your subform) it attempts to free it. But since it is already done in the onClose event (Action := caFree) it is trying to free a non-existing object resulting an access violation. Try to create your subform like TMyForm.Create(nil); Or don't use caFree in the onClose event. You should consider using MyForm := TMyForm.Create(nil); Try MyForm.sFormID := '3'; MyForm.ShowModal; Finally MyForm.Free; End; if applicable.
  9. aehimself

    Delphi 10.4 PATCH 2 experiences

    And here I though, that the CommandLine is internally using a ConHost process (Windows Console Host) which is provided by the operating system with AllocConsole for example. I must be wrong. In that, we definitely agree.
  10. aehimself

    Delphi 10.4 PATCH 2 experiences

    Obviously. I forgot that the one and only way to start a batch file is Windows Explorer. Why are we paying sysadmins, if the answer is always so easy...?
  11. aehimself

    Delphi 10.4 PATCH 2 experiences

    There is no such thing as hardwired to File Explorer; it is just an application which requires elevated privileges due to it unzips files to the Program Files folder. I suggest you to take a look at how UAC works on Vista+ and how you can auto-elevate everything if it disturbs you that much. While I completely admit that this "patch tool" is utterly useless, don't blame Emba because of how UAC works.
  12. aehimself

    How to detect the active app

    I should pay more attention to the details; I thought I used one of these functions before. As I checked my sources - you are right. GetForegroundWindow it is.
  13. aehimself

    Centered message?

    While the idea clearly works, there's a huge flaw with it: I don't like tea.
  14. aehimself

    Patch 2 for RAD Studio 10.4 now available

    Am I wrong to expect that the PatchTool is simply unzipping the Patch2.zip file? On an isolated test machine with no Internet available I unzipped the patch manually and simply overwrote the files. Patch1 worked this way. The appearance of PatchTool made me wonder...
  15. aehimself

    Anybody up for an ethics question?

    I'd simply re-throw exceptions in an understandable way; you now can even use RaiseOuterException to include the data from the first one. When I am working in a service application which should operate 24/7 without interruptions, I'm placing a Try ... Except in the worker thread only. It picks an item to process from the queue, if it fails, it logs why and places it back to the end of the queue. Once an item failed to process 3 times it is discarded. Specifications (even if given by the client) are only specifications. Our client keeps sending invalid XMLs for us to process, even though they created the validating XSD for that very document. So yes, expect bad data; no matter what. But depending on the needs - don't change values and/or swallow errors because the code looks... cleaner. I'd suggest TryStrToInt and it's counterparts, or simply Val. That way you know if/where the expected data is malformed and can Rase Exception.Create('The length of your shoes must be a number, not "' + s + '"');
  16. aehimself

    How to detect the active app

    GetTopWindow or GetActiveWindow, depending on your needs function SecondsIdle: DWord; var liInfo: TLastInputInfo; begin liInfo.cbSize := SizeOf(TLastInputInfo) ; GetLastInputInfo(liInfo) ; Result := (GetTickCount - liInfo.dwTime) DIV 1000; end;
  17. aehimself

    How do you organize developing new features in big projects?

    Deleted. Post went to the wrong place...?
  18. aehimself

    How do you organize developing new features in big projects?

    Modularity is the key. And the beauty of inheritance makes it really-really easy. Since I started to chip my code to as small blocks as possible, separate classes of course; I realized that I started to move more and more of these one-class units to my Framework folder, out of an applications folder. And they simply all work together.
  19. Overkill and requires a heavy backend. Git is free and you can create your upstream repository on a backed up fileshare. More than enough, especially if you are new to source control.
  20. aehimself

    Scrollbar creation in C++

    While I have no experience with C++ builder, nor FMX, but if the "ScrollBox" component is available, you can use that. Place one on your form, set the Align to alClient and put your components on the scrollbox instead of the form.
  21. When I made a parser like this I was working with indexes returned by String Helpers. Look for the first opener, look for the first closer from the opener. Make sure there are no quotes (or even number of quotes) in between. Make sure there are equal amount of openers and equal amount of closers in between. I'm not saying it was the fastest solution, but it worked 🙂 And it handled nested sections correctly, too.
  22. aehimself

    TcheckListBox: Hiding the Values?

    Yep, you have so much freedom you can easily do Var tb: TBytes; a: Integer; Begin SetLength(tb, 5); For a := 0 To 5 Do tb[a] := 1; End; or... Var pc: PChar; Begin GetMem(pc, 5 + 1); StrPCopy(pc, 'abcde', 5); End; or even: Var obj: TObject; proc: TProcedure; Begin proc := addr(obj); proc; End; Just because you have the possibility of doing something it doesn't mean you are supposed to or should. Btw, I thought this forum is a politic-free area. Please take those ideologies to Reddit.
  23. aehimself

    TcheckListBox: Hiding the Values?

    Because - TCheckListBox.Items is TStrings, and .Values are supported by TStrings. I would not be surprised if this was not meant to be used as value storage; due to the reason you just very asked.
  24. aehimself

    TcheckListBox: Hiding the Values?

    In a more advanced project (especially after a UI change or refactoring) you'll quickly realize why separating the UI and data storage/handling extremely important. In your example, let's say a user doesn't like CheckListBox and wants you to change it to something else. Apart from the visual changes, you'll have to re-code your business logic as well. It is not that important in "personal use" applications, but lately I have a separate class for data storage everywhere. The UI only displays, validation, (de)serialization, everything is handled by the class itself.
  25. aehimself

    TcheckListBox: Hiding the Values?

    I don't feel fine storing information in the UI. I'd rather create a separate TList<TMyValue> and add the values to it as I'm adding the checkboxes. This way the index of the CheckBox will be equal to the index of it's value in the TList.
×