Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 05/03/24 in Posts

  1. Rather than editing SysUtils (and having to keep your changes up to date every time you upgrade Delphi), Detour the function calls you are concerned about: https://github.com/MahdiSafsafi/DDetours You can hook all of the relevant API calls and return whatever values you want.
  2. This little utility always worked pretty well for me: RunAsDate
  3. Anders Melander

    Block Component Exit Event on Cancel?

    You really shouldn't prevent the user from moving the focus; It's one of the most annoying ways to do validation. Instead do your validation in the OK handler. If you use TActionList you can also do the validation in the OnUpdate event handler and only enable the OK button when all validations pass. If you want to be really nice to your users do the validation while they are entering data but instead of blocking them just indicate errors with color or a symbol.
  4. Remy Lebeau

    Cursor "crNo"

    crNo DOES map to a system cursor - IDC_NO: Why it is not transparent, who knows. Ask Microsoft.
  5. #ifdef

    Cursor "crNo"

    You're a bad detective, Sherlock...
  6. This does not make much sense IMO since how the text looks when viewing the file depends on the font the viewing application uses in the window that displays the file content, i.e. the width of what you consider a "column" depends on the font. If you cannot control that you may be better served by using tab characters instead of spaces for alignment. That format also imports easier into Excel etc.
  7. Anders Melander

    How to calculate Unicode text width?

    ...or one could just use TCanvas.TextWidth (VCL) TCanvas.TextWidth (FMX)
  8. Anders Melander

    How to calculate Unicode text width?

    That doesn't help with aligning text in a text file.
  9. michel.seicon

    Memory not freed in Linux but freed in Windows

    @Lars Fosdal Dear Lars Fosdal Thank you very much for your tip. To solve the problem, simply call the "libc" library function. Below if you have the same problem type TMalloc_trim = function: Integer; cdecl; var LibHandle: THandle; Malloc_trim:TMalloc_trim; const SOName = 'libc.so.6'; begin LibHandle := LoadLibrary(PChar(SOName)); Malloc_trim := GetProcAddress(LibHandle, PChar('malloc_trim')); if Malloc_trim=1 then showmessage('Success') esle showmessage('Memory freeing not allowed'). Please close this case.
  10. Vincent Parrett

    Microsoft Trusted Signing service

    Yep, need a degree in nonsense to understand how anything works in azure. A few years ago we evaluated all the major cloud providers when considering moving everything to the cloud, trying to compare pricing etc - azure dropped out of the running pretty quickly as we all found it too confusing to use. Anytime you need to configure something, it sends you off on a bunch of side hussles to configure something else with zero explaination, and when something goes wrong it's very difficult to figure out what you need to do. Bloated, over architected monstrosity.
  11. Remy Lebeau

    New to delphi

    I think you mean a design-time package. Why are you recompiling the VCL? Don't do that. Your project is clearly not setup correctly. Start over with a fresh project, and add your existing project source files to it. And make sure your design-time package (not a runtime package!) has the DesignIDE package listed in its requires clause. You should not be compiling DesignIntf.pas directly.
  12. Nobody really cares that much. It's a gruesome way to go. I'd solve the problem properly but you don't want to tell us what the problem is.
  13. Anders Melander

    The function of EmptyWorkingSet

    You are. The working set are the pages of a process' virtual memory that resides in physical memory. They are there because the process has a need for them to be there (e.g. it has referenced an address in virtual memory causing a working set page to be mapped to that address). If something else in the system has a need for physical memory, and it's all in use (which, by design, is normally is - because why not) then the least recently used pages will be paged out and eventually written to the page file, so the physical page can be mapped to the other process' working set. The above is just a simplification of the virtual memory management but the point is that, unless what you are doing is really extreme, then you don't have to think about it; It just magically works. I know everybody has to go through the phase of thinking that they can outsmart the OS virtual memory management by messing with the working set but you really should leave it alone. The OS virtual memory system was designed 50 years ago by people who actually knew what they were doing. You might very well be having memory issues but look to the memory manager instead. The working set isn't the problem.
  14. The integration isn't really the important part although it's nice to be able to navigate the source while the help editor/navigator follows along. Extracting comments from the source can already be done by the compiler so that isn't that interesting for me personally. Also, I find that, although it appears to make sense to document the API in the source, it ends up completely obfuscating the source. I prefer to have the help text separate from the source. DI has an option to either maintain in-source comments or store the data in external files. Like this: <?xml version="1.0"?> <doc> <members> <member name="AnsiCompareText(string,string)"> <summary>Compares strings based on the current locale without case sensitivity.<br></br> <br></br> AnsiCompareText compares str1 to str2, without case sensitivity. The comparison operation is controlled by the current locale.<br></br> </summary> <param name="str1">The first string to be compared.</param> <param name="str2">The second string to be compared.</param> <returns> <list type="table"> <listheader> <term>Condition</term> <description>Return value</description> </listheader> <item> <term>str1 = str2</term> <description>Zero.</description> </item> <item> <term>str1 &gt; str2</term> <description>Positive value.</description> </item> <item> <term>str1 &lt; str2</term> <description>Negative value.</description> </item> </list> </returns> <seealso cref="CompareText"></seealso> <seealso cref="AnsiCompareStr"></seealso> <seealso cref="CompareStr"></seealso> </member> ... If your project/document architecture allows for separating layout (the way it looks), structure (classes, members, functions, types, etc) and content (help text per structure item), then "all you need" is a parser and some UI to manage the parts. Easy-peasy, when can I have it 🙂
×