Jump to content

JonRobertson

Members
  • Content Count

    278
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by JonRobertson

  1. 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.
  2. 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."
  3. 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.
  4. 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;
  5. 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;
  6. 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.
  7. JonRobertson

    VTK in DelphiVCL or DelphiFMX

    I have not heard of VTK and decided to take a peak. The documentation references examples using MFC and C++ Builder. However, the Win32 folder is no longer present in the Examples\GUI folder in their git repo. Searching the history of the repo, the C++ Builder examples were removed five years ago. I suspect getting support for using VTK in Delphi will be challenging, since the group stopped supporting C++ Builder years ago. That said, the old code is available via git history. For example, vtkBorlandRenderWindow.cpp. This snippet is from GetRenderWindow: // Stuff the renderwindow into our window FRenderWindow = vtkWin32OpenGLRenderWindow::New(); FRenderWindow->AddObserver( vtkCommand::AbortCheckEvent, FAbortCallback); FRenderWindow->SetParentId(Parent->Handle); Without a deep dive into the source, it appears VTK is using OpenGL for rendering and setting the OpenGL's window parent to a form. If I wanted to use VTK from Delphi, I would attempt: Use a supported open source C++ compiler to build the C++ source to either OBJ or LIB. There are multiple OBJ file formats. Delphi can link with OMF86 or COFF for 32-bit and ELF or COFF for 64-bit. See Link object file (Delphi) for more details. Translate the VTK headers to Pascal, which will be a challenge. From what little I have read, VTK appears to use features only available in newer versions of C++. There are some open source projects for converting headers, although they may not be able to convert the VTK headers. The second one specifically does not convert C++ headers. I included it because it uses libclang, which I suspect would provide a better translation for the "pure C" portions of headers. https://github.com/yunkot/HeaderParser https://github.com/neslib/Chet There are others. Search engines are your friends. ;) Well, most of the time. Another alternative is Python4Delphi, since VTK can be used from Python and appears to actively support use from Python. An advantage of this approach is the ability to "prototype" using standalone Python and then incorporate into a Delphi app via Python4Delphi. You have likely seen Pyscripter's posts in this forum. https://github.com/pyscripter/python4delphi
  8. JonRobertson

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

    I have heard or read many "justifications" for dismissing Delphi, but never that one. That said, DevExpress does have excellent components. I currently do not have the privilege of a license for any. Thank you for pointing out TdxLayoutControl , along with the video. I need to spend a little time to put together a proposal, I suppose, for my managers.
  9. JonRobertson

    Print TDBGrid

    I found FortesReport Community Edition on GitHub. The only documentation that I saw is in the source code and is in Portuguese. Or you could roll-your-own. There is some example code in this StackOverflow answer: https://stackoverflow.com/questions/7496813/print-a-tdbgrid/7500147#7500147
  10. If you are referring to persistent fields added via the Field Editor IDE window, the compiler will only complain if you update the field list after you update a query. If the query is changed and no longer returns one of the persistent fields, or returns a different data type for a persistent field, the code will still compile. Those "errors in dependent code" will not occur until run-time.
  11. JonRobertson

    MyDAC : Unknown column error

    The error "42S22 Unknown column" is not coming from the Delphi compiler, MyDAC, or the underlying TDataSet. It is coming from MySQL. From an online search, the error means that the field specified (FILEVERSION) in the field list of the SQL statement is not a column in the table. https://sebhastian.com/mysql-unknown-column-field-list/ When you call MyTable.Open, MyDAC is generating a SELECT statement based on the fields that you have added to your MyTable component. That SELECT statement has FILEVERSION in its field list. When executed by MySQL, the unknown column error occurs. I don't know if the following will work with TMyTable, but it might since TMyTable has TDataSet as an ancestor. Drop another TMyTable component on the form or datamodule. Set its properties to the same connection, database, and table as your current TMyTable component. Double-click on the new TMyTable component. If a fields window appears, right-click it and select Add Fields (or press Ctrl-A). When the Add Fields dialog appears, is FILEVERSION in the list? Using the debugger, ShowMessage, or logging, verify at run-time that the Connection and Database properties on your MyTable component are set to the expected values.
  12. JonRobertson

    Delphi Report Builder - Failed to export report on second attempt

    Is the report's pipeline a TppDBPipeline? If so, add a BeforePrint event handler to the TppReport component. In the event handler, call Dataset.First on the master/primary dataset used by the report. I do not have 22.04 available to test whether that is an issue. With 22.03, the dataset is Eof after the report is exported and attempting to generate or export the same report a second time results in an empty report. I would expect you would have seen some dialog informing you of an Access Violation before you tried to debug, unless there is code in your unit that is "eating" exceptions (an empty except/end block). Looking at RequestPage in 22.03, my first thought is that a pipeline, datasource, or dataset is being destroyed before the TppReport component is destroyed. In the unit containing the line CustomReport.PrintReport, is there any code that calls Free to destroy an object?
  13. JonRobertson

    Delphi and "Use only memory safe languages"

    Or US-CERT advisories from DHS. The advisory below may be 9 years old, but the Delphi language/RTL/VCL is as memory safe today as it was then. Possibly less safe. https://www.coresecurity.com/core-labs/advisories/delphi-and-c-builder-vcl-library-heap-buffer-overflow
  14. JonRobertson

    Class Arial not found when using PowerPDF

    I installed PowerPDF in Delphi 12 from GetIt Package Manager. Delphi 12 locked up on me due to LSP not responding. I killed that, Delphi 12 closed, and I went to try again. When I opened Delphi 12 again, the PowerPDF components were installed (despite the earlier lockup). I dropped a PReport on a form, followed by a PRPage, and the IDE showed the same "Class Arial not found" message that you have. I opened PowerPDFDR.dproj, opened PReport.pas from the Project Manager, and added PdfFonts to the uses clause (as suggested above). "Build" PowerPDFDR,dproj, "Build" PowerPDFDD.dproj, "Install" PowerPDFDD. I am now able to drop a PRPage on a form without error.
  15. JonRobertson

    Class Arial not found when using PowerPDF

    I am not sure what you are comparing. PDFFonts.pas on github does not have different versions of the source units by Delphi version. There is only one PDFFonts.pas. SysUtils not being in the uses clause of PDFFonts.pas would not cause the issue that you are seeing. If SysUtils is needed by PDFFonts, a compile error would occur when building the component package or compiling any unit that references PDFFonts. It is also possible that SysUtils was moved from the interface uses clause to implementation, or vice-versa.
  16. JonRobertson

    Class Arial not found when using PowerPDF

    Open PReport.pas and add PDFFonts to its uses clause. I'd suggest after PdfImages: PdfImages, PdfFonts {$IFDEF USE_JPFONTS} Close PReport.pas. Open the DelphiPowerPDF group project and do Build All. If you don't have the group project, build PowerPDFDR followed by PowerPDFDD. (Building PowerPDFDD should not be required, but I always build run-time followed by design-time when rebuilding packages.) Now go back to your project and see if you can add a TPrPage without getting the exception.
  17. JonRobertson

    Class Arial not found when using PowerPDF

    Actually, that would only solve a run-time exception. If the exception is occurring in the designer, then the code that registers the components in the IDE is not registering the PDF font classes.
  18. JonRobertson

    Class Arial not found when using PowerPDF

    Windows fonts are not represented as individual classes in the Delphi VCL. This error is occurring because PowerPDF is trying to create an Arial class implemented by PowerPDF. The actual class name is TPdfArial. It is registered in PdfFonts.pas. My guess is the design-time support in PowerPDF is lacking and that the unit PdfFonts is not added to the uses clause when you drop a TPrReport on it. (I do not have PowerPDF installed to test.) If PdfFonts is not in your uses clause, add it and then try adding/dropping a TPrPage on the form.
  19. JonRobertson

    TPngImage help needed for vague docs

    The Graphic property does not represent the "type of graphic". Think of it more as a helper class that is capable of loading multiple graphic formats. The only "conversion" is unpacking the image file format, such as color depth, color map or palette, compression, etc, to a Windows Bitmap GDI object. Once an image is loaded, SaveToFile or SaveToStream may be used to write the image to a different format. Yes. If you look at the source for TPicture.LoadFromFile, you will see that it internally uses TGraphic to load an image. Looking at the source code is an excellent way to find answers, particularly if the documentation seems lacking or confusing. They are used the same way. Depending on the file type you have loaded the required object is created. To expand a little, loading an image only creates one instance of a graphic class. Bitmaps, icons, metafiles, and WIC images are not the same type of image. Try loading a TImage with a PNG (Image1.Picture.LoadFromFile('image.png')) and using the Icon property to save it as an icon (Image1.Picture.Icon.SaveToFile('image.ico')). The exception "Icon image is not valid" will be raised. However, using Picture.SaveToFile('image1.ico') does work, at least in the test that I did. Random flounder is an excellent way to learn. Create a new VCL project, throw a TImage on the form, and try various things to see what works and what doesn't. Take some time to look at the underlying source code. Start with Vcl.Graphics.pas for the foundation, then look at the Vcl.Imaging units, such as GIFImg.pas, JPEG.pas, and PNGImage.pas. That is what I did while writing this message.
  20. JonRobertson

    TPngImage help needed for vague docs

    Once you add pngimage to the uses clause of any unit, the TPNGImage class is registered with TPicture, which enables your application to load and save PNG images. This is done in the initialization section of pngimage.pas (TPicture.RegisterFileFormat('PNG', 'Portable Network Graphics', TPngImage);). This provides PNG support to any class that uses TPicture to load or save impages, for example: TImage.Picture.LoadFromFile. If you want more control over the image itself, then declare and use an instance of TPNGImage and the provided methods and properties to load, save, or modify the PNG image as desired.
  21. JonRobertson

    Docking Example

    I found a demo project at https://github.com/Walibeiro/DockDemo. And a 9 page article that Brian Long wrote, titled Drag & Dock, published in issue 63 (November 2000) of The Delphi Magazine. I did not find anything more recent. I don't recall any significant changes to docking in the Delphi VCL. It has also been 9 years since I worked on an application with dockable forms.
  22. JonRobertson

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

    The Delphi compiler is also a single pass compiler, unlike C/C++. Being a single pass compiler is one of the reasons that Delphi builds projects much faster than a similar C++ project. I would expect changing Delphi to support multi-pass compiling would be a huge task with few benefits. But I don't know much about writing a compiler.
  23. It may very by Delphi version. $(OUTPUTFILENAME) worked for me in Delphi 11.3.
  24. You could try a pre-build event as a workaround: CMD /C DEL $(OUTPUTFILENAME) If your output path or filename has spaces, try CMD /C DEL "$(OUTPUTFILENAME)"
  25. JonRobertson

    A native VCL, and not Windows-based, TComboBox control.

    As does the Delphi debugger.
×