Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: Debugger error
« Last post by Martin_fr on Today at 06:06:12 pm »
If you got a Windows security warning, check if the exe still exists.

I have seen that a few times, that Windows defender deletes the freshly compiled exe, before it can be debugged.  Especially (but not only) when the exe has been recompiled several times in a short time => Windows sees the accumulated changes of the exe (caused by recompiling it) as "evasive action".

And yes, I am 100% sure that in the cases I observed it was a clean exe and no virus was involved anywhere on the system. I restored the exe, and send to virustotal and https://metadefender.opswat.com/ => both reported 100% clean.

Try to exclude the folder from Windowsdefender https://support.microsoft.com/en-us/windows/add-an-exclusion-to-windows-security-811816c0-4dfd-af4a-47e4-c301afe13b26

 
2
General / Re: Debugger error
« Last post by 440bx on Today at 06:03:13 pm »
What happens when you start the process from the command line ? (IOW, no debugger involved.)
3
General / Debugger error
« Last post by bobonwhidbey on Today at 05:55:42 pm »
I've created a terrible bug in my program. It seems to be intermittent. I can not trace to the offending line. Once the program hangs - it can't be closed with the upper right [X] in Windows, but I can stop Laz (Ctrl-F2).
See attached error message that I've never seen before. I also get a "Windows Security" warning in the lower right of my screen shortly after getting the Debugger error message.

I've tried Dwarf 3 and also Dwaft-2 with sets. Anyone have an idea what's going on here? I'm not looking for help debugging my program but a clue as to what kind of error could trigger that error message.
4
Graphics / Re: Drawing grid lines on a transparent image
« Last post by KodeZwerg on Today at 05:42:19 pm »
Here an example:
(I have assigned in designer an image to the TImage control.)
Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls;
  9.  
  10. type
  11.  
  12.   { TForm1 }
  13.  
  14.   TForm1 = class(TForm)
  15.     CheckBox1: TCheckBox;
  16.     Image1: TImage;
  17.     Panel1: TPanel;
  18.     procedure CheckBox1Change(Sender: TObject);
  19.     procedure FormCreate(Sender: TObject);
  20.   strict private
  21.     FBMP: TBitmap;
  22.   private
  23.   public
  24.  
  25.   end;
  26.  
  27. var
  28.   Form1: TForm1;
  29.  
  30. implementation
  31.  
  32. {$R *.lfm}
  33.  
  34. { TForm1 }
  35.  
  36. procedure TForm1.FormCreate(Sender: TObject);
  37. begin
  38.   FBMP := TBitmap.Create;
  39.   FBMP.Assign(Image1.Picture.Bitmap);
  40. end;
  41.  
  42. procedure TForm1.CheckBox1Change(Sender: TObject);
  43. var
  44.   i: Integer;
  45.   GridSize: Integer;
  46.   LBMP: TBitmap;
  47.   X, Y: Integer;
  48. begin
  49.   GridSize := 50;
  50.   LBMP := TBitmap.Create;
  51.   try
  52.     LBMP.PixelFormat := pf32bit;
  53.     LBMP.Width := Image1.ClientRect.Width;
  54.     LBMP.Height := Image1.ClientRect.Height;
  55.     if CheckBox1.Checked then
  56.       begin
  57.         X := 0;
  58.         Y := 0;
  59.         LBMP.Assign(Image1.Picture.Bitmap);
  60.         LBMP.Canvas.Brush.Color := clBlack;
  61.         LBMP.Canvas.Brush.Style := bsSolid;
  62.         for i := 0 to GridSize do
  63.           if ((X + GridSize) < LBMP.Width) then
  64.             begin
  65.               Inc(X, GridSize);
  66.               LBMP.Canvas.FillRect(X, LBMP.Canvas.ClipRect.Top, Succ(X), LBMP.Canvas.ClipRect.Bottom);
  67.             end;
  68.         for i := 0 to GridSize do
  69.           if ((Y + GridSize) < LBMP.Height) then
  70.             begin
  71.               Inc(Y, GridSize);
  72.               LBMP.Canvas.FillRect(LBMP.Canvas.ClipRect.Left, Y, LBMP.Canvas.ClipRect.Right, Succ(Y));
  73.             end;
  74.       end
  75.     else
  76.       LBMP.Assign(FBMP);
  77.     Image1.Picture.Bitmap.Assign(LBMP);
  78.   finally
  79.     LBMP.Free;
  80.   end;
  81. end;
  82.  
  83. end.
If you can follow my code, FBMP keeps the original unmodified version of your image, the checkbox control if there are gridlines drawn over or if it replace current with original.
5
General / Re: Compile/Convert Delphi project to MacOS
« Last post by Martin_fr on Today at 05:29:03 pm »
If you don't use forms....

then you shouldn't need cocoa related code.... Well except, maybe timers, or there are a few things that you could use without GUI that still need code that  knows about GUI...

Some of your units, would use the package LCL or LCLBase (or a package that then uses either of those). Question is, if that unit is used for a reason, or was added by accident.
If the latter, then if you remove all LCL dependencies, and remove the package from the list of required packages, then you don't need interfaces => and your app will become quite a bit smaller.



For the rest... Out of index error => that is something wrong in your code (or code that you called).

Index 0 out of bound => list is empty.

Don't continue, press "break" and it should show you the code that causes the error. Though sometimes you need to open the "stack window" and find the code in the list of callers.

6
General / Re: Lazarus features in a non-graphical environment
« Last post by Lutz Mändle on Today at 05:26:34 pm »
I do not know, how to do an FPC compilation, using these kind of Lazarus features. It is obvious that I cannot have Lazarus running, but then what sort-of makefile or config file is needed to compile Lazarus projects with FPC only.

If your project has a lpi-file try lazbuild, a typical command to compile one of my projects is:

lazbuild -B --no-write-project --ws=nogui <projectname>.lpi

This can be done from a ssh login prompt without a graphical environment.
7
General / what's difference between Variant and TVarRec?
« Last post by egsuh on Today at 05:24:24 pm »
They seem very similar. Well, TVarRec is variant record. But isn't variant variant record?
8
General / Re: Compile/Convert Delphi project to MacOS
« Last post by Joseph on Today at 05:17:16 pm »
So here's what change:

- The project does not use forms.

- Adding Interfaces seems to improve (or at least change the error). Project seems to compile until error1.png (see joined img), and 'continue' leads to error2.png (see joined img).

- No more previous errors on linker

I have a meeting tomorrow with the creator of this project, so maybe I'll have some other info or relevant input from him to add here.
10
General / Re: splitting an image
« Last post by Thaddy on Today at 04:52:43 pm »
LoadFromStream/SaveToStream?
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018