Questions tagged [lazarus]

Lazarus is an open-source multiplatform RAD environment for the Free Pascal compiler, in the spirit of Delphi, with which it has a fairly high degree of compatibility.

Lazarus is a an open-source multiplatform RAD environment for the Free Pascal compiler, in the spirit of Delphi, with which it has a fairly high degree of compatibility.

See http://lazarus.freepascal.org

1306 questions
3
votes
1 answer

Lazarus resource - Using a resource leads to an error in linking

I searched around but found not any solution, so I try here: I want to integrate images (I did it with delphi before in this way) that are used by my program and load them at runtime. My idea was to 1.) create a resource file with lazres…
hy-soft
  • 163
  • 2
  • 12
3
votes
2 answers

How to create makefile for Lazarus projects?

After doing a light search on the Lazarus site I've come to the conclusion that this question has been asked some times but I haven't found an answer, so I'll ask my SO peers. Is there a a way to create a Makefile to replicate the action of the…
Gustavo Carreno
  • 9,499
  • 13
  • 45
  • 76
3
votes
2 answers

How to Invalidate only part of a paintbox/bitmap to optimise its performance?

The question relates to: Drawing on a paintbox - How to keep up with mouse movements without delay? I was going to at some point ask the question of how to repaint only part of a paintbox without invalidating the whole paintbox, which is slow when…
user1175743
3
votes
2 answers

Getting application version number in Lazarus project not working

I'm using the following unit to try to read the application version number in a Lazarus project but GetProductVersion always returns 0.0.0.0 http://forum.lazarus.freepascal.org/index.php?topic=13957 I'm using Lazarus 1.2.4 with FPC 2.6.4 on Windows…
Fat Monk
  • 2,077
  • 1
  • 26
  • 59
3
votes
4 answers

Checking to see if a number is within a range in free pascal

I am trying to figure out the correct way of passing an example that was using Free Pascal case statements to a simple if statement. Using case would be begin usingCaseStatements; var user_age : Integer; begin Writeln('Please enter your…
Alex_adl04
  • 562
  • 6
  • 17
3
votes
1 answer

Accessing record field by reference

I have to use records in Lazarus (due to TVirtualStringTree). If I have a simple record: type myrec = record name: string; end; Is there a way how to access the field by reference? i.e. to make a function: getField('name',…
hugo
  • 76
  • 6
3
votes
1 answer

How do I free the memory in this case?

I have this type definition: KMenuClass = class private pMenuID: String; public property MenuID: String read pMenuID; constructor Create(const paraMenuID: String); end; Then I do this: constructor KMenuClass.Create(const…
itsols
  • 5,406
  • 7
  • 51
  • 95
3
votes
3 answers

DLLImport crash in Mono (linux): icall_wrapper_mono_marshal_free

I'm stucked with a problem with Mono Interop in Linux. I have a native shared library (made in Lazarus) that I need to use in a C# assembly. The shared library is used by a Mono C# assemblie on Windows and on Linux. The assembly loads the shared…
Arcturus
  • 65
  • 3
3
votes
2 answers

Problem with Splash Screen in Lazarus app

I am porting a Delphi application to FPC/Lazarus and this application shows info in splash screen. When unit has initialization section then this initialization section calls something like: Splash.Info(unit_name) This works in Delphi, but when I…
Michał Niklas
  • 53,067
  • 18
  • 70
  • 114
3
votes
1 answer

TOpenDialog And Spaces

I have a project on Lazarus that I want to compile a source using gcc, for this I have a TOpenDialog called OpenDialog1 and a TProcess called AProcess. I call gcc with this code: procedure TFormMain.btCompileClick(Sender: TObject); begin if…
Nathan Campos
  • 28,769
  • 59
  • 194
  • 300
3
votes
2 answers

What is the best approach to inherit methods from classes that exits after verification?

What is, in Delphi/Lazarus/FreePascal the best way to inherit parents method verification that exits from the method? Suppose the following classes and methods: type TPlant = class public FIsGreen: Boolean; procedure DoPhotosynthesis;…
EMBarbosa
  • 1,473
  • 1
  • 22
  • 76
3
votes
1 answer

Catching stack-trace in Free Pascal

I have a console application written in Free Pascal, that like most larger applications sometimes crashes. As this application is live, I usually ask people to write me down the stack-trace on crash -- I distribute it with both debug and lineinfo.…
Kornel Kisielewicz
  • 55,802
  • 15
  • 111
  • 149
3
votes
1 answer

Should I be referencing to Field or Property names?

I have been writing different classes lately, and I have noticed that I have inadvertently been reading / writing to them using both field and property identifiers, and I am wondering what are the pitfalls if any of doing this? Lets use a basic…
user1175743
3
votes
2 answers

Memory leaks in Lazarus, How to Debug them using Heaptrcon?

In Delphi XE I always used ReportMemoryLeaksOnShutDown to detect any leaks when exiting my Applications, most my projects were rather small and finding the leaks was usually not too difficult. In Lazarus there is no such option but I have just found…
user1175743
3
votes
1 answer

How to get sqldb to use a particular fbclient.dll?

I'm using sqldb to connect to Firebird from within my DLL. This fails because it cannot find fbclient.dll which is actually present in the same directory as my DLL. GetCurrentDir returns the path to the Windows system folder. Performing a…
Thijs van Dien
  • 6,516
  • 1
  • 29
  • 48