delphi

Do Delphi generic collections override equals?

This is a question for the generic collection gurus. I'm shocked to find that TList does not override equals. Take a look at this example: list1:=TList<String>.Create; list2:=TList<String>.Create; list1.Add('Test'); list2.Add('Test'); Result:=list1.Equals(list2); "Result" is false, even though the two Lists contain the same ...

how to fixed a number of dynamic buttons in 1 row?

i have create 7 dynamic buttons in a scroll box. Each row need to have 2 buttons (number of buttons may change) only, but the result of the code below shows the first row with 2 buttons but all the rest in 2nd row, how should i fixed it to 2 buttons 1 row? procedure TForm1.CreateDynamicBtn2; var abtn: TBitBtn; i, j, iNum, iCount ...

Progress feedback in stateless HTTP session

I need to program a stateless server to execute remote methods. The client uses REST with a JSON parameter to pass the method name and its parameters. After servicing the result the session is closed. I have to use Indy10, TCP/IP as protocol, and therefore look at using IdHTTPServer. Large result sets are chunked by Indy10 and sent to t...

Delphi Environment Setup for Package / Component Development

After reading some mailing lists and bbs, I couldn't find a proper way to setup my development environment for package and component development. Perhaps we can collect some tipps here for a good setup. For component development it is suggested to create a runtime package containing the runtime code for the component and a design time ...

Send and Receive a simple string value with Indy (Delphi)

Hi, is there any way to send a simple text(string value) without using WriteLN and ReadLN? The ReadLn function needs LF char and when I'm sending a text message via winsock to Indy, ReadLn cannot get the message correctly and some exceptions will be happen continuously. ...

Delphi class references... aka metaclasses... when to use them.

I've read the official documentation and I understand what class references are but I fail to see when and why they are best solution compared to alternatives. The example cited in the documentation is TCollection which can be instantiated with any descendant of TCollectionItem. The justification for using a class reference is that it a...

Updating Firebird UDF Library to Delphi 2010

With Delphi 2006, I was using a library of User Defined Functions that was based on tbudf.pas and some functions that I added on my own. Since I am working on a payroll program, this functionality is very helpful for some common payroll concepts that might otherwise require some complex SQL. I have kept my Delphi 2006 installation and ...

How write a file to STDIN Stream using DELPHI?

Hi, I need to write a FILE to STDIN. This FILE going to be accessed by another EXE that goig to write the STDIN stream in a microcontroller. Could you give me a help how to write the file to STDIN using Delphi 2010? Thanks very much! Abraão ...

Using a TTimer For Adding Letters On a TextBox

I want to know how can I use a TTimer object to do an infinite loop, that should add the letter N on a TextBox every second. But without freezing the application. ...

please get me the following Delphi to Java conversion

1.Client procedure TForm1.ButtonKoneksiClick(Sender: TObject); begin if ClientSocket1.Active then begin ClientSocket1.Active := false; end else begin ClientSocket1.Address := EditIPServer.Text; ClientSocket1.Port := StrToInt(EditPortServer.Text); ClientSocket1.Active := true; end; end; ...

Deadlock on tidtcpserver.active = false (Delphi2007/indy10)

I am having a problem with some code that was written by a developer that has now left our company, the code implements a tcpserver that responds to an XML based protocol. This appears to be working absolutely fine in our test environment but one or two customers are having problems with application shutdown. I have traced this to what...

How to implement GetExitCodeProcess in the following code?

Also in the following code, which is more efficient? if (Length(ParamStr(1)) <> 0) then or if (ParamStr(1) <> '') then {$A8,B-,C-,D-,E-,F-,G+,H+,I-,J-,K-,L-,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V-,W-,X+,Y-,Z1} program LaunchUAC; uses Windows, ShellAPI; {$R 'MANIFEST.RES'} (* <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!-- C...

What is TMonitor in Delphi System unit good for?

After reading the articles "Simmering Unicode, bring DPL to a boil" and "Simmering Unicode, bring DPL to a boil (Part 2)" of "The Oracle at Delphi" (Allen Bauer), Oracle is all I understand :) The article mentions Delphi Parallel Library (DPL), lock free data structures, mutual exclusion locks and condition variables (this Wikipedia art...

Datasnap Service application fails

I have created a Datasnap service, using Bob Swart's white paper as a guide. I have been debugging and deployed succesfully using the VCL Forms application as a server. But when I try to deploy the service version, it installs ok, I then try to start the service and it immediately stops. The error in the event log would suggest that t...

How to show this splash screen for 3 seconds?

Hello, I created my splash screen using the method mentioned here: http://delphi.about.com/od/formsdialogs/a/splashscreen.htm I need to show the splash screen for 3 seconds before showing the main form. Please help. Thanks. ...

how to run command line from delphi

hi all how can i run this command from my delphi C:\myapppath\appfolder>appname.exe /stext save.txt i tried like this ShellExecute(0, nil, 'cmd.exe', 'cd C:\myapppath\appfolder', nil, SW_Hide); ShellExecute(0, nil, 'cmd.exe', 'appname.exe /stext save.txt', nil, SW_Hide); but not working any help please thanks in advanc...

C to delphi converting

Hi, can somebody tell me where I am making mistake in the converting: C: typedef struct _REGISTRY_EVENT { REG_NOTIFY_CLASS eventType; TIME_FIELDS time; HANDLE processId; ULONG dataType; ULONG dataLengthB; ULONG registryPathLengthB; /* Contains path and optionally data */ UCHAR registryData[]; } REGISTRY_...

How to change a generic type value?

Hello, In my application, I've created the TList type list, intended to store Integers or Doubles: TKList<T> = class private FItems: TList<T>; function GetItem(Index: Integer): T; procedure SetItem(Index: Integer; const Value: T); function GetMaxValue(): T; function GetMinValue(): T; public constructor Creat...

Why does adding Action cause Fatal Error in Delphi

I'm using Delphi 2009. My program has been compiling and running fine. I use Action lists and have them built into my program - although I haven't changed them in a while. So today I go to simply add a new action to my ActionList in the normal manner that it is done. Without doing anything else, I now build and run my program and I get ...

How to switch the 'current' directory of a TOpenDialog in an OnTypeChange handler? (is it possible at all?)

Depending on the chosen filter, I'd like the OpenDialog to 'look' in different directries. Something like: procedure TForm1.FileOpen1OpenDialogTypeChange(Sender: TObject); // This does not work as intended... var Dialog: TOpenDialog; FilterIndex: Integer; FilterExt: string; Path: string; begin { TForm1.actFileOpenOpenDialogTypeC...