lazarus

Problem compiling a WebLaz project under Lazarus

半世苍凉 提交于 2019-12-22 00:53:38
问题 My specs: OS: Ubuntu 10.04 LTS amd64 fpc: 2.4.0 lazarus: 0.9.28 I'm trying to compile a WebLaz project just by creating one and then compiling. Somehow the compiler gets all lost when determinig witch httpd and fpapache Units to use. I've found similar problems in the forums: mod_helloworld.lpr Can't find fpapache Unit ... I NEED HELP with fpweb ... After trying some of the solutions provided there I'm still at this point: Project compiles fine if I only have httpd22 under the Compiled units

What are the differences between implementation of Interfaces in Delphi and Lazarus (FPC)?

血红的双手。 提交于 2019-12-21 12:05:09
问题 We have a project full of custom components that today is working in Lazarus and Delphi. I'm thinking in code interfaces on it, but I am not much familiar with them. What I would like to know is: What are the implementation nuances from Delphi and Lazarus interfaces? There is something that I should be specially aware? Will I have to code really different things? Background explanation: I think the components could benefit from interfaces, or at least, I will learn more from them. For example

How to get Windows user privileges information with Lazarus/Free Pascal

不羁岁月 提交于 2019-12-21 06:00:57
问题 Using Lazarus/Free Pascal, how can I get the user privileges of the user running my program (whether he's an Administrator, Regular user, or Guest)? 回答1: As David says in a comment you can use the CheckTokenMembership function to determine the membership of an user account. check this sample which runs on FPC and Delphi. program Test; {$IFDEF FPC} {$mode objfpc}{$H+} {$ELSE} {$APPTYPE CONSOLE} {$ENDIF} uses SysUtils, Windows, Classes; Const SECURITY_NT_AUTHORITY: TSIDIdentifierAuthority =

Call procedures from different forms

∥☆過路亽.° 提交于 2019-12-20 05:36:14
问题 I am using Lazarus and I have a form called TForm1 and the unit name's Unit 1. Inside here I have a procedure called mergeDATfile(a:shortint); that makes some stuff. By the way I had to create another form called TForm2 and inside this I have button (Button1). When it is pressed, it must call mergeDATfile(a:shortint); from the 1st form. How could I do it? 回答1: The obvious solution is to move the MergeDatFile function into a common unit which can then be used by both form units. 回答2: I am

How can you change the text orientation in cells in the fixed rows in a Delphi TStringGrid

别说谁变了你拦得住时间么 提交于 2019-12-17 20:46:53
问题 I have a standard TStringGrid on a form. I have one Fixed Row in the grid that contains a number of columns, which are all TGridColumns objects. I have set the column titles using the object inspector and the default orientation is horizontal. Is there any way you can make the orientation vertical (like you can in cells in Excel)? 回答1: Here's how to render the first row's text vertically in Lazarus: unit Unit1; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, Forms, Controls,

Exception raised when setting Text property of TEdit in custom component (Lazarus)

跟風遠走 提交于 2019-12-13 21:00:24
问题 Using: Lazarus 1.2.0; Windows 32-bit application I have created a custom component derived from TCustomPanel and contains some TEdit controls. At runtime, when I try to set the Text property of an edit control in my component, I get a runtime error. This is the error: Project project1 raised exception class 'External: SIGSEGV'. In file '.\include\control.inc' at line 3246: GetTextMethod := TMethod(@Self.GetTextBuf); I Googled and could not find anybody else reporting this error specifically

Lazarus Free Pascal / Delphi - RunError 211

百般思念 提交于 2019-12-13 18:29:43
问题 I'm trying to connect my Windows XP program (Lazarus) to my Ubuntu postgres server. When the Lazarus program runs, it seems to compile fine but I get this error: Project ... raised exception class 'RunError(211)'. Then it terminates execution (and I don't see any output), and opens up a file customform.inc . In that file, it shows a procedure procedure TCustomForm.DoCreate; where it highlights a line: if Assigned(FOnCreate) then FOnCreate(Self); I believe this is one of the system's files. I

How do I load hierarchical data from a database into a tree view

旧城冷巷雨未停 提交于 2019-12-13 03:56:04
问题 I have a database table with data and need to load the fields into a TTreeView object. The line: ItemTree.Items.AddChild(nil, CurrentField_Text); simply adds a node to the top level. How can I specify a point to insert it in? Please note that while looping through the data from the table, I may (for example) insert 3 top level items and then the 4th element is actually the child of node 2. How can I specify this? 回答1: This is some code lifted directly from a program of mine which inserts

How to avoid WSRegister* on a Free Pascal .dll/.so

独自空忆成欢 提交于 2019-12-12 23:27:32
问题 I finally had success compiling a "blank" Apache module, but now I've hit a rather annoying snag. I want to communicate with a MongoDB server and I opted for the only lib around for FreePascal/Lazarus, pebongo. Dependency for pebongo is synapse. Somehow I'm getting "/usr/lib/apache2/modules/mod_visius.so: undefined symbol: WSRegisterCustomImageList" when loading my module into Apache. I've tracked down the symbols onto Menus.pp, I think, and lazarusall(something) also plays a role in this.

Cannot get ComboBox selected item value

佐手、 提交于 2019-12-12 22:09:48
问题 I am using this code at the moment. I need to get the String value of the selected item of a ComboBox: procedure TForm5.BitBtn5Click(Sender: TObject); var c,k,t,g: string; begin //Get the name of the items c := ComboBox1.Items[ComboBox1.ItemIndex]; k := ComboBox2.Items[ComboBox2.ItemIndex]; t := ComboBox3.Items[ComboBox3.ItemIndex]; g := ComboBox4.Items[ComboBox4.ItemIndex]; //Show it ShowMessage(c); end; The ComboBoxes have items inside as you can see here because I fill them in an onCreate