Jump to content

dummzeuch

Members
  • Content Count

    2977
  • Joined

  • Last visited

  • Days Won

    106

Everything posted by dummzeuch

  1. Personally I see nothing wrong with using exit there. I usually add a comment to it to make it more visible. procedure SaveData2(aID: Integer; const aName: string); var i: Integer; vNewData: TDataRec; begin for i := Low(Data) to High(Data) do if Data[i].DataID = aID then begin Data[i].DataName := aName; Exit; //==> end; // Save new Data rec, if ID not found // ... end; (But people have criticized me for adding that comment.) Of course purists will tell you that exit is just a goto in disguise and that "everybody knows that "goto is considered harmful".
  2. dummzeuch

    Grep search empty window with 10.4.1

    Hm interesting. Is your Grep results window docked or undocked? I just tried it (but not with a project group but a single project) and got a different effect: The background of the results window is black. Switching to a different tab in the history list fixes that. But then other strange effects happened: The history list all of a sudden displayed the match list rather than the history. Something seems to mess with the controls or the handles in that dialog. (My bet is on the theming of the IDE.)
  3. Have you checked the map provider's license terms? Map data is usually not free. OpenStreetMap is free, but there are of course still conditions. If you have an internet connection, you can download our rendered tiles from there. You need to calculate the right coordinates, construct the download URLs, download the tiles and display them. It's not rocket science, but also not as easy as it sounds. We use an internally developed map component, which can display data from various sources (including OpenStreetMap). Developing that definitely wasn't simple. Be prepared to learn a lot about different geographical coordinate systems. Probably more than you ever wanted to know. Also, rendering map data in a way that looks nice is not simple. Our component is still far from looking nice. Using pre-rendered tiles makes that a lot easier.
  4. dummzeuch

    Grep search empty window with 10.4.1

    Are you using the new DLL for 10.4.1 ?
  5. dummzeuch

    Grep search empty window with 10.4.1

    Not that I am aware of.
  6. The usual way to get version information for a file goes like this: type TEXEVersionData = record CompanyName, FileDescription, FileVersion, InternalName, LegalCopyRight, LegalTradeMarks, OriginalFilename, ProductName, ProductVersion, Comments, PrivateBuild, SpecialBuild: string; end; function TCustomFileInfo.ReadVersionData: TEXEVersionData; type PLandCodepage = ^TLandCodepage; TLandCodepage = record wLanguage, wCodePage: Word; end; var Dummy: Cardinal; Len: Cardinal; Buf: array of Byte; pntr: Pointer; lang: string; begin Len := GetFileVersionInfoSize(PChar(Filename), Dummy); if Len = 0 then RaiseLastOSError; SetLength(Buf, Len); if not GetFileVersionInfo(PChar(Filename), 0, Len, @Buf[0]) then RaiseLastOSError; if not VerQueryValue(Buf, '\VarFileInfo\Translation\', pntr, Len) then RaiseLastOSError; lang := Format('%.4x%.4x', [PLandCodepage(pntr)^.wLanguage, PLandCodepage(pntr)^.wCodePage]); if VerQueryValue(@Buf[0], PChar('\StringFileInfo\' + lang + '\CompanyName'), pntr, Len) { and (@len <> nil)} then Result.CompanyName := PChar(pntr); if VerQueryValue(@Buf[0], PChar('\StringFileInfo\' + lang + '\FileDescription'), pntr, Len) { and (@len <> nil)} then Result.FileDescription := PChar(pntr); if VerQueryValue(@Buf[0], PChar('\StringFileInfo\' + lang + '\FileVersion'), pntr, Len) { and (@len <> nil)} then Result.FileVersion := PChar(pntr); if VerQueryValue(@Buf[0], PChar('\StringFileInfo\' + lang + '\InternalName'), pntr, Len) { and (@len <> nil)} then Result.InternalName := PChar(pntr); if VerQueryValue(@Buf[0], PChar('\StringFileInfo\' + lang + '\LegalCopyright'), pntr, Len) { and (@len <> nil)} then Result.LegalCopyRight := PChar(pntr); if VerQueryValue(@Buf[0], PChar('\StringFileInfo\' + lang + '\LegalTrademarks'), pntr, Len) { and (@len <> nil)} then Result.LegalTradeMarks := PChar(pntr); if VerQueryValue(@Buf[0], PChar('\StringFileInfo\' + lang + '\OriginalFileName'), pntr, Len) { and (@len <> nil)} then Result.OriginalFilename := PChar(pntr); if VerQueryValue(@Buf[0], PChar('\StringFileInfo\' + lang + '\ProductName'), pntr, Len) { and (@len <> nil)} then Result.ProductName := PChar(pntr); if VerQueryValue(@Buf[0], PChar('\StringFileInfo\' + lang + '\ProductVersion'), pntr, Len) { and (@len <> nil)} then Result.ProductVersion := PChar(pntr); if VerQueryValue(@Buf[0], PChar('\StringFileInfo\' + lang + '\Comments'), pntr, Len) { and (@len <> nil)} then Result.Comments := PChar(pntr); if VerQueryValue(@Buf[0], PChar('\StringFileInfo\' + lang + '\PrivateBuild'), pntr, Len) { and (@len <> nil)} then Result.PrivateBuild := PChar(pntr); if VerQueryValue(@Buf[0], PChar('\StringFileInfo\' + lang + '\SpecialBuild'), pntr, Len) { and (@len <> nil)} then Result.SpecialBuild := PChar(pntr); end; (This is based on http://stackoverflow.com/a/5539411/49925 ) This only handles the case of known strings. But you can put any additional strings into it, e.g.: LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US 1 VERSIONINFO LOADONCALL MOVEABLE DISCARDABLE IMPURE FILEVERSION 1, 3, 6, 577 PRODUCTVERSION 1, 3, 6, 577 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEOS VOS__WINDOWS32 FILETYPE VFT_APP { BLOCK "StringFileInfo" { BLOCK "040904E4" { VALUE "CompanyName", "dummzeuch.de\000" VALUE "FileDescription", "dzlib PrepBuild commandline and IDE prebuild tool\000" VALUE "FileVersion", "1.3.6.577\000" VALUE "InternalName", "PrepBuild\000" VALUE "LegalCopyright", "Copyright 2002-2020 by Thomas Mueller\000" VALUE "LegalTrademarks", "\000" VALUE "OriginalFilename", "PrepBuild.exe\000" VALUE "ProductName", "PrepBuild\000" VALUE "ProductVersion", "2020-05-31\000" VALUE "Comments", "<svn range=\"87:92\" modified=\"yes\" url=\"https://svn.osdn.net/svnroot/dzprepbuild/trunk\" />\000" VALUE "Revision", "\000" VALUE "BuildDateTime", "2020-05-31\000" } } BLOCK "VarFileInfo" { VALUE "Translation", 1033, 1252 } } This contains two additional strings: Revision (which is empty) and BuildDateTime. There could be many more. But, how do I get these strings without knowing their name? VerQueryValue requires me to pass it the name of the string I want to read, so that's not a solution.
  7. dummzeuch

    How do get all strings from a version resource

    There are some odd entries in the resources of BDS.EXE and BDS.fr: And some other executables do not have proper version info: So they do not display anything when read the usual way (like e.g. in the Properties dialog in Windows). Older Delphi versions still refer to Appmethod in the translations (this is XE8): (I definitely had too much time on my hands today. 😉
  8. dummzeuch

    How do get all strings from a version resource

    Got it to work. Now the GExperts PEInfo tool also shows all strings in all languages stored in the version info resource which includes the non-standard once like BuildDateTime:
  9. But it would probably also fail. As long as I don't know what causes this it's pointless to try.
  10. dummzeuch

    How do get all strings from a version resource

    There apparently is an official documentation for the VS_VERSIONINFO structure. Which then references the VarFileInfo structure, which in turn refers to the Var Structure, and the StringFileInfo structure, which in turn refers to the StringTable structure, which then refers to the String structure. Not simple but doable. I also found some C++ code to read the VS_VERSIONINFO structure on StackOverflow https://stackoverflow.com/a/43229358/49925 I'll see where it that gets me.
  11. Or maybe even better: Somebody with such a high resolution to find the problem. (Or somebody who sponsors me a high resolution monitor 😉 ) Which monitor are you using? Would you recommend it?
  12. dummzeuch

    remove ExplicitXxxx properties

    In theory they are used to preserve the original size and position of controls when they are set to alClient, alTop etc. so when they are set back so alNone at a later time, they automatically revert to their original size and position. Personally I never found that useful and since these values tend to change very often (no idea why, they shouldn't) they pollute the DFM diffs and history.
  13. dummzeuch

    Delphi 6 all of a sudden wants to be activated

    WTF? Now it simply starts again! I hate it when problems go away without finding out what the cause was.
  14. I think I fixed this now. At least it works for me in Delphi 10.4.1. Could you please compile and test it?
  15. dummzeuch

    10.4.1 Released today

    Around that time Borland developed JBuilder, so maybe it really came from Java.
  16. dummzeuch

    10.4.1 Update

    In my case, deleting a custom desktop layout which was automatically loaded for a project, solved that problem. I then had to create that desktop layout again.
  17. dummzeuch

    Grep search empty window with 10.4.1

    That's odd, because GExperts only uses the standard runtime packages that come with the IDE. The other third party sources (e.g. SynEdit) are compiled into the DLL (one reason why GExperts cannot be a package based IDE plugin).
  18. dummzeuch

    Grep search empty window with 10.4.1

    Yes I meant "Parse map file". But it doesn't matter as with "empty" you meant something totally different than I expected. Thanks for the screenshot.
  19. dummzeuch

    Grep search empty window with 10.4.1

    Works fine for me in 10.4.1 What do you mean by "empty" in this context? Could you please post a screen shot? What are you grep'ing for? Have you maybe enabled or disabled the "use .map file" option in the new version? Is that the released version 1.3.16 or did you compile it from sources?
  20. dummzeuch

    10.4.1 Released today

    No. It's just very easy to miss. Bad installer UI. Yeah, just found it on the third try. As you said: Bad UI.
  21. dummzeuch

    10.4.1 Released today

    No, it doesn't say anything about the reason, just crashes and I get the Windows error dialog.
  22. dummzeuch

    10.4.1 Released today

    Not so impressed: Installation worked fine and was fast, but ... The Web-Installer installed to c:\program files (x86) even though my 10.4 installation was somewhere else. When the IDE started with my custom layout (which is not a floating designer layout), I get an AV in rtl270.bpl. The same happens when I try to switch to that layout later. Trying to load any existing project crashes the IDE I'll do an uninstall and try again, this time trying to not miss the option for a custom installation path. I seem to remember from other installations that there was one. Edit2: Uninstalling, deleting the Registry entries and also deleting the old installation directory fixed both crashes. Edit3: Missed the option to select a custom installation path three times. It's here:
  23. dummzeuch

    10.4.1 Released today

    Interesting, I didn't even know this exists. Now that I do, I found that Steve Trefethen blogged about it in 2005: Command line option to display menu item names in Delphi 2006
  24. dummzeuch

    Securing your data over time

    I'm not sure whether I'd care much about Delphi projects when my house burns down. But on the other hand, I don't have a house, I live in a rented flat, so maybe I would care.
  25. Maybe virtualization is causing the slow down the original poster is talking about? I never install anything to program files, that wants to write to its installation directory. Virtualization has bitten me to many times.
×