Jump to content

JonRobertson

Members
  • Content Count

    171
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by JonRobertson

  1. JonRobertson

    DelphiLint v1.0.0 released!

    I installed it but I was not able to use it. The first issue is that the BPL is not signed and our corporate policy would not allow Delphi to load the BPL. I worked around the issue by signing the BPL with our code signing certificate. The next issue is that DelphiLint is unable to download SonarDelphi from GitHub. A better error message would be appreciated. The dialog simply says to check my internet connection, which is definitely working at the moment. I am about to download SonarDelphi manually. Hopefully the documentation will have instructions on configuring DelphiLint so it "knows" that SonarDelphi is installed.
  2. JonRobertson

    Hunting a unit reference

    That is why I would rename the unit. When the project fails to compile, the error should occur in the unit that is "using" the unwanted unit. Note that it often requires a Build rather than just a Compile to locate the unit containing the reference.
  3. JonRobertson

    Code Review for Delphi and Pascal

    Apparently is possibly accurate. Supposedly is more accurate, at least that was the case six months ago. My rant on DerScanner
  4. JonRobertson

    What new features would you like to see in Delphi 13?

    And has not been possible since Delphi 1.
  5. JonRobertson

    What new features would you like to see in Delphi 13?

    Yes, unless you have the C++ source and wanted to create a C++ DLL that could be used from Delphi using a COM interface. http://rvelthuis.de/articles/articles-cppobjs.html
  6. JonRobertson

    TFrame versus SubForm

    Thanks for letting me know. I do not have much experience with the various DPI issues.
  7. JonRobertson

    What new features would you like to see in Delphi 13?

    How was it possible with Delphi 1?
  8. JonRobertson

    TFrame versus SubForm

    Not sharing components, or sharing a single instance of a component. If a frame contains an ImageList and is used on multiple forms, each form creates a separate instance of the frame and all components on the frame. So you have multiple copies of the same ImageList, but those forms are not "sharing" the ImageList. I use a TDataModule for resources and components, such as TImageCollection and TVirtualImageList, that are used by multiple forms.
  9. JonRobertson

    TFrame versus SubForm

    I don't agree with this. frmView := TfrmView.Create(Self); frmView.Parent := tsView; This makes the tabsheet the parent of the form. So now all controls on the form have the tabsheet as a grandparent, if you will. But the parent of each control on the subform is not changed to the tabsheet.
  10. JonRobertson

    TFrame versus SubForm

    My laptop's "recommended" scaling is 125%. At the office, I have two external monitors, each has recommended scaling of 150%. I started this position eight months ago. The first project that I worked on uses a "tabbed interface", similar to web browsers, where each form is created and parented to a TTabSheet. Nothing more than setting frmSomeForm.Parent := tsSomeForm. Every form, except a few "dialog box" forms, are embedded in the app's main form. Two of the forms in that application also contain a TFrame, which is on the form at design-time rather than created and attached at run-time. I have not seen any DPI related issues since switching to DPI Unaware mode when launching BDS.
  11. JonRobertson

    Delphi and "Use only memory safe languages"

    I would agree that it is easier than using C++, among others. But Delphi is also just as capable of generating executables that overwrite memory or have vulnerabilities, due to poor or improper memory handling. In that sense, I don't think Delphi has better memory safety than C++. And certainly capable of being used to intentionally expose memory related vulnerabilities.
  12. JonRobertson

    TFrame versus SubForm

    The one difference that I encounter is that a "SubForm" is not linked to anything at design-time. If you have placed a TFrame anywhere in the project, the frame is now linked and "in use" by the designer. I often encounter "has open descendents [sic] or linked modules. Cannot close." dialogs when trying to modify a frame, TDataModule descendant, or a base form (when using form inheritance). This often happens when I try to switch between form designer and DFM text editing. I can close every unit that the editor/designer has open, re-open the "linked" unit, and still can't switch to text DFM. At that point, I could just edit the DFM in my favorite text editor, except Delphi will not reload the DFM once my edits are finished. So I typically restart the IDE. I still use D7 occasionally. While this does happen in D7, and I remember it in D6, there seem to be more scenarios where D11 refuses to switch and D7 doesn't.
  13. JonRobertson

    Delphi and "Use only memory safe languages"

    Although I've been programming for 42 years, I know so little compared to how much there is to know. So thanks for the link. My preference is to handle/control the lifetime of memory allocations based on the purpose and usage, rather than leaving it to algorithms that attempt to figure that out. The code below is a hand-slap, don't ever do that. It was also the first thought I had to show that the memory manager does not "know" anything, unless it is told. Algorithms may be written to read my mind. But I digress... function BadAlloc(Size: NativeInt): String; begin var pStr: PChar; GetMem(pStr, Size); StrPCopy(pStr, 'bad code'); Result := IntToStr(Integer(pStr)); end; procedure BusyProc; begin var myBad := BadAlloc(20); // lots of other busy code... ShowMessage(PChar(StrToInt(myBad))); end; My expectation is that tracing garbage collection could release the 20 byte block immediately after BadAlloc returns, or any other time before the ShowMessage is executed.
  14. JonRobertson

    Delphi and "Use only memory safe languages"

    The memory manager would have to "know" when the memory was no longer needed, otherwise it would release allocated memory too soon. Unless I don't understand the question, it sounds like Automatic Reference Counting, which was already attempted. And it was later removed for a few reasons.
  15. JonRobertson

    Delphi and "Use only memory safe languages"

    I do, and I suspect many others do as well "Promoting tools to help in this area" sounds good. But "Sounds good" is marketing rubbish.
  16. JonRobertson

    Delphi and "Use only memory safe languages"

    I do, and I suspect many others do as well. What I was mostly disappointed about was the statement below. The company promoted in that link and the accompanying webinar was DerScanner. I watched the webinar last September and it intrigued me enough to ask approval to pursue having a small project analyzed and review the results. Their home page had a short form to request a trial. Instead of providing a trial, I received an email that I will share, since it is typical marketing: I responded that I requested a trial from their home page. The reply was that my request for a trial was forwarded and included a whitepaper that "describes the key features of DerScanner". One of the key features was that DerScanner could analyze 36 programming languages, "even obsolete Delphi, COBOL and Visual Basic 6.0". I also noticed that the short form on their home page was changed from a trial request to "Get a Demo". They did provide a trial account and I submitted the project along with a couple third-party libraries (with each vendor's permission). The resulting report contained thousands of incorrect analysis. One of the more prominent and obnoxious was “hardcoded encryption key”, for code such as "ctrlKey := GetKeyState(VK_Control) < 0", and every other line of code that contained these three characters in sequence: k e y, including static text. The analysis that DerScanner provided was a complete joke and a total waste of time. The trial included two scans for free (I only used one), additional scans after the trial were $1,000 per scan. Sure, my employer can say "Yes, we are concerned about security. We had our application analyzed by a third-party that specializes in code analysis. They used a highly sophisticated tool named grep to analyze our code for vulnerabilities." I am particularly disappointed in the recent statement because I had direct contact with Ian regarding my frustrating experience, and the laugh that I had after reviewing the generated report.
  17. JonRobertson

    What new features would you like to see in Delphi 13?

    My thought is that it is already too easy for code to be scattered rather than organized. At times, I get flustered trying to find my own code, let alone working in a code base that I didn't write. And the impact on the Delphi compiler and "breaking interface changes". When a change is made in the interface section of a unit, other units that depend on the change must be recompiled. But when changes are made only in the implementation or other sections of a unit, dependent units don't have to be recompiled. The compiler tracks these dependencies automatically and recompiles units only when necessary.
  18. JonRobertson

    What new features would you like to see in Delphi 13?

    Not for me. I'd want a compiler option to turn it off. But that wouldn't prevent others from using it.
  19. JonRobertson

    Alternative to VMWare??

    VirtualBox User Manual - Snapshots
  20. JonRobertson

    Alternative to VMWare??

    I would suspect it depends on your usage and needs. I used to configure and manage VMs for a dev/QA test environment, initially using VirtualPC and later migrating to Hyper-V. Today I do not use VMs as often as I used to. I use Parallels Desktop on my MacBook Pro and VirtualBox on my other laptops.
  21. JonRobertson

    GrijjyCloudLogger & D12

    Ping @Allen@Grijjy ? Have you tried using it? Per Getting Started, "To use GrijjyCloudLogging in your Delphi project all you need to do is include the Grijjy.CloudLogging unit in your uses list."
  22. JonRobertson

    Delphi 12: internal errors

    Does it occur again on the same project? DCUs are Delphi version specific (with a couple of notable exceptions). If Delphi 12 successfully your project after you manually deleted DCUs, but this error occurs again in Delphi 12 building the same project, then something is wrong. Perhaps something is off with your Delphi 12 install or environment. Or perhaps it is a defect in the compiler. Open a support ticket as DelphiUdIT suggested. An online search reveals a couple other things to try in the meantime. If it is a large project, go to Project Options, Building, Delphi Compiler, and set "Use MSBuild externally to compile" to true and see if that helps. Another suggestion is to disable the compiler's use of an unit cache. This is done by modifying the registry entry HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\22.0\Compiling\Enable Unit Directory Cache.
  23. JonRobertson

    Delphi and "Use only memory safe languages"

    Not on my system. A simple grep of 51,132 .pas files tells a different story. (Just a whole word search with no context). pointer, 150,825 hits in 7,939 files ^, 110,934 hits in 6,326 files Searching a few more popular (and current) open source libraries reveals significant use in current code. 8,625 hits was the highest I found in a single open source library on my system. Delphi 12 source\rtl\sys - 2,837 hits. 1,871 hits in system.pas alone. Delphi 12 source\rtl\common - 2,951 hits Delphi 12 source\rtl\win - 6,442 hits. I was surprised to see 2,243 of those are in the winrt subfolder. Delphi 12 source\rtl\osx - 4,751 hits Then there are thousands of casts using TObject(), such as storing object references in the legacy TList or, ahem, storing references or pointer values in TComponent.Tag. If I overlook RTL usage, VCL usage, and poor coding practices, every day Delphi coding uses pointers. At least I do. // lstOfItems is a pointer. You may say it is a "typed pointer", but it is still a pointer. ;) var lstOfItems := TStringList.Create;
  24. JonRobertson

    MyDAC : Unknown column error

    From the docs, KeepDesignConnected is not about auto connecting to the design-time connection. If the project is built with Connected set to True, then loading the form/datamodule/components will set the property's state to True when the form is loaded, making (or trying and failing) to make the connection before your code starts. That is standard VCL component behavior for published properties. By setting KeepDesignConnected to False, the component will not make a connection during form load, even if the Connected property was saved as true. There are several other workarounds. There are add-ons that will set various property values every time the form is saved. Personally, I derive a component and change the stored attribute of the property, like so TmyADOConnection = class(Data.Win.ADODB.TADOConnection) published property Connected stored False; property LoginPrompt stored False; end;
  25. JonRobertson

    VTK in DelphiVCL or DelphiFMX

    Same LOL here. My first reply would have been much shorter had I paid attention to the forum. One of the dangers of reading from Recent Activity, I suppose.
×