Jump to content

Cristian Peța

Members
  • Content Count

    344
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Cristian Peța


  1. I have almost the same configuration and bellow settings for display but I don't see any issues with scrolling. In VM is Windows 1903, on host 2004.

    I don't do any adjustments to the IDE after instalation.

    I will try to install Windows 2004 also in one VM and see.

    Update: I can install now Windows 2004 only on older VM's, on newer VM's with D10.3.3 and 10.4 I have this message "The Windows 10 May 2020 Update is on its way. Once it’s ready for your device, you’ll see the update available on this page."

    image.thumb.png.4f0fedc88af06656c342e3524458f197.png


  2. Then it looks like it's deallocated at close. Maybe if you can debug and look in task manager. Put a break point in System._Halt0 and maybe you will see where is deallocated.

    Maybe deallocation is in finalization sections or some dll's.

    Maybe this MemoryUsed function can be called from watch list and compared with Task manager.


  3. 5 hours ago, kzaveri19 said:

    When the error is caught, cursor stays in the same cell, but wrong value displayed across all records

     

    I can't reproduce this issue (the wrong value to be displayed across all records). What Delphi version do you use?

    Try to do a minimal example to reproduce this and post here.

    5 hours ago, kzaveri19 said:

    I modified your code slightly

    But why ?!? Your code is more convoluted and I don't see any benefit. Only trouble.


  4. This procedure takes 76% of time in my case
    2694    procedure TfrxPDFExport.ExportViaVector(const Memo: TfrxCustomMemoView);

     

    and was called because GapY was -1

      if (Memo.ReducedAngle <> 0) or (Min(Memo.GapX, Memo.GapY) < 0) then
        ExportViaVector(Memo)

    With Gap=0 for some of memo components ExportViaVector() takes 44% of time and the report looks the same but the PDF is generated in 6 seconds vs. 13 seconds

     

    Edit: Better take a profiler and don't lose the time guessing.

    • Like 2

  5. Have you tried with Microsoft driver?
     

    frxReport9.PrintOptions.PrnOutFileName := 'name.pdf';
    frxReport9.PrintOptions.Copies := 1;
    frxReport9.PrintOptions.ShowDialog := False;
    frxReport9.PrintOptions.Printer := 'Microsoft Print to PDF';
    frxReport9.SelectPrinter;
    frxReport9.Print;

     


  6. At Export() that 5000 records doesn't count because the report is prepared.

    How many pages are? How many items per page? There are also vector images like charts or EMF, WMF?

     

    I tested for example 40 pages (200 records with one image and 30 text items per record) with booth FR Export and printing to "Microsoft print to PDF". The speed is about 3 seconds for both on a i7-8700K CPU. This is only Export because I do this at preview where the report is already prepared.

     

    P.S. You are too scarce with details and want a suggestion.....

    • Like 1

  7. From the call stack it looks like Validate is called a little to late to modify the value. Documentation says also "To reject the current value of the field from the OnValidate event handler, raise an exception."

    I would use Abort like this:

     

    procedure TfrmClose.tbCloseAmtValidate(Sender: TField);
    begin
      if Sender = nil then
        exit
      if (Sender.DataSet.FieldByName('Long Short').AsString = 'Long') then
      begin
        if (Sender.AsFloat < 0) then
        begin
          ShowMessage('Close value should be positive or zero');
          Abort;
        end;
      end
      else if (Sender.DataSet.FieldByName('Long Short').AsString = 'Short') then
      begin
        if (Sender.AsFloat > 0) then
        begin
          ShowMessage('Close value should be negative or zero');
          Abort;
        end;
      end;
    end;

     


  8. Take a profiler and save you time guessing what is slow.

    I use Nexus Quality Suite and I like it but there are also some free alternatives. Actually first time I used it I found the bottleneck with the trial version of NQS. I like very much line profiler. If you try it for these 4 lines it is very probably the first line and not the last that is the bottleneck. Then you goo deeper.

     

    P.S. If the time is big enough you can see also in debugging if the first or last line is slower. If the last line is slow then not the dataset is bottleneck but maybe some very big picture.


  9. 6 hours ago, PeterPanettone said:

    However, your employer has to pay for the time you need to write overloaded code. (Though I assume you're a fast writer). 

    Depends. I added only 15K LOC last year to my project. A lot of time I spend thinking how to add features asked by customers to actual app logic. This doesn't have to do with old code but to old app logic and not to break old behavior. An to leave space for feature improvements because this is a 20 years old project.

    • Like 3

  10. 22 minutes ago, Ian Branch said:

    My issue/point is that I am NOT getting the message.

    I must repeat: this is documented and is working "as designed"

    If you want an other behavior and don't want to do what documentation says the you need to find an other OS.

     

    Documentation says: "If your application must block or postpone system shutdown, use the ShutdownBlockReasonCreate function."

    Then when you are finished use ShutdownBlockReasonDestroy.


  11. 4 hours ago, Ian Branch said:

    if MessageDlg('Windows is shutting down! First save data changes?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin

    This is not just a message. You are waiting for the user to press You or No. And in this time you are not returning to the OS. Then the OS will simply kill you app.


  12. 4 hours ago, Ian Branch said:

    I never see the MessageDlg prompt.

    This is documented here (read Remarks): https://docs.microsoft.com/en-us/windows/win32/shutdown/wm-queryendsession

    If you really need to stop the shutdown: "Each application should return TRUE or FALSE immediately upon receiving this message"

    So you must return immediately, not showing a message and wait...

    But... "Applications should respect the user's intentions and return TRUE"

    If possible it's better to save data in other place and next time you app is running again ask the user if he want to keep this data. Or even better, if you can, restore the app state exactly how it was at shutdown and you don't need to ask anything. The user will see your app exactly how it was at shutdown. That's how mobile app are supposed to work but it's nice also for desktop.

×