Jump to content

JonRobertson

Members
  • Content Count

    278
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by JonRobertson

  1. Yes you do, as long as you have the source code. You have complete control over when a DM is created.
  2. JonRobertson

    DelphiLint v1.0.0 released!

    I suggest creating an Issue here. And there is no reason for an option to be added. The plug-in should determine the correct paths and Delphi version without needing you to configure it.
  3. JonRobertson

    DelphiLint v1.0.0 released!

    Done. Issue 207
  4. JonRobertson

    DelphiLint v1.0.0 released!

    Thanks for the extra info. Downloaded and renamed. The first unit that I tried to analyze gave this error: DelphiLint encountered a problem during analysis. An error was raised (java.lang.OutOfMemoryError: Java heap space ). That unit has 464 lines of code. The entire project has 12,533 lines of code, not counting Delphi RTL, VCL, and third-party components. So this isn't a large project by any means. This laptop has 32GB of physical memory and 13.5 GB was available at the time of the analysis.
  5. JonRobertson

    Minimal working Example for libgit2-delphi

    Your original declaration declared a pointer, but never assigned it to anything. Since it is a local variable on the stack, it contained a garbage/random value rather than a pointer to actual data. Darian's suggestion changed your declaration to an instance of data. Using @repoPP then passed the memory address (pointer) of the data to the DLL. See The @ Operator
  6. JonRobertson

    DelphiLint v1.0.0 released!

    I am curious what the "standalone" version would download from GitHub. Following the link to install SonarDelphi, you need to install SonarQube, then SonarScanner, then install the SonarDelphi plug-in in SonarQube. I installed SonarQube and configured a database via the install instructions. But the SonarQube service refuses to start.
  7. 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.
  8. 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.
  9. 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
  10. JonRobertson

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

    And has not been possible since Delphi 1.
  11. 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
  12. JonRobertson

    TFrame versus SubForm

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

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

    How was it possible with Delphi 1?
  14. 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.
  15. 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.
  16. 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.
  17. 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.
  18. 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.
  19. 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.
  20. 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.
  21. 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.
  22. 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.
  23. 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.
  24. 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.
  25. JonRobertson

    Alternative to VMWare??

    VirtualBox User Manual - Snapshots
×