delphi

Delphi #IF(DEBUG) equivalent?

Is there a Delphi equivalent of the C# #if(DEBUG) compiler directive? ...

Delphi Active Commercial Components

Similar to the Delphi FOSS component question, a commercial component directory will also be a valuable searchable resource. I invite you to contribute your expierience with your favourite commercial components and also share with us your experiences with commercial components that doesn't make the grade as well. Then there is the questi...

AVI Animations for GUI

Hello I need to get some AVI animations for use with the Borland VCL TAnimate component, to display during operations such as 'online update', 'burning cd' and a few others. I have only come across the glyFX Animation Pack so far. Can anybody recomend other places to get nice avi animations? Thanks in advance. ...

Not Nil shortcut in Delphi

What delphi function asserts that an object is not nil? ...

Precision of reals through writeln/readln in Delphi

My clients application exports and imports quite a few variables of type real through a text file using writeln and readln. I've tried to increase the width of the fields written so the code looks like: writeln(file, exportRealvalue:30); //using excess width of field .... readln(file, importRealvalue); When I export and then import ...

Ideas to replace Stored Procedure in Cash Flow report

We have a Cash flow report which is basically in this structure: Date |Credit|Debit|balance| 09/29| 20 | 10 | 10 | 09/30| 0 | 10 | 0 | The main problem is the balance, and as we are using a DataSet for the Data, it's kinda hard to calculate the balance on the DataSet, because we always need the balance from the previous ...

tStringList passing in C# to Delphi DLL

I have a Delphi DLL with a function defined as: function SubmitJobStringList(joblist: tStringList; var jobno: Integer): Integer; I am calling this from C#. How do I declare the first parameter as a tStringList does not exist in C#. I currently have the declaration as: [DllImport("opt7bja.dll", CharSet = CharSet.Ansi, CallingConvention...

How do I merge TMainMenu's that use separate imagelists and retain the correct images by each menu item?

I have a program with two TForm classes and have added a TMainMenu to them each. I am then trying to merge them dynamically at run-time. My problem is that when they merge the menu items in the merged in TMainMenu now display images stored in the imagelist in the form they were merged into rather than the images stored in their original...

How to solve Delphi's [Pascal Fatal Error] F2084 Internal Error: LA33 ?

I'm really sick of this problem. Google searches always seem to suggest "delete all bpls for the package", "delete all dcus". Sometimes this just-does-not-work. Hopefully I can get some other ideas here. I have a package written in-house, which had been installed without issue a few months ago. Having made a few changes to the source, I...

How to draw delphi group boxes to have transparent backgrounds

I'm trying to get something very subtle to work, it looks pretty awful right now. I'm trying to paint the background of a TGroupBox which I have overloaded the paint function of so that the corners are show through to their parent object. I've got a bunch of nested group boxes that look very decent without XPThemes. Is there a way to ...

What is function in Delphi to get the current executing thread?

I want a function like GetCurrentThread which returns a TThread object of the current executing thread. I know there is a Win32 API call GetCurrentThread, but it returns the thread Id. If there is a possibility to get TThread object from that ID that's also fine. ...

Open an ANSI file and Save a a Unicode file using Delphi

For some reason, lately the *.UDL files on many of my client systems are no longer compatible as they were once saved as ANSI files, which is no longer compatible with the expected UNICODE file format. The end result is an error dialog which states "the file is not a valid compound file". What is the easiest way to programatically op...

Update fonts recursively on a Delphi form

Hello, I'm trying to iterate all the controls on a form and enable ClearType font smoothing. Something like this: procedure TForm4.UpdateControls(AParent: TWinControl); var I: Integer; ACtrl: TControl; tagLOGFONT: TLogFont; begin for I := 0 to AParent.ControlCount-1 do begin ACtrl:= AParent.Controls[I]; // if ParentFo...

Seeking a way to have a "Hover button" to expand a section

i have a flow panel that i'm adding extra items to it at runtime based on whether they have chosen to show all the items. that's all works fine; the expansion is controlled by a toolbar button. the trouble is we'd like the user to be able to move his mouse over the "+" sign to expand the section. initially i looked at TSpeedButton (...

How to implement find as you type on a TComboBox descendant

What is the correct way to implement the "find as you type" behavior on a TComboBox descendant component whose style is csOwnerDrawFixed? ...

How to simulate a Delphi breakpoint in code?

I am pretty sure I have seen this before, but I haven't found out / remembered how to do it. I want to have a line of code that when executed from the Delphi debugger I want the debugger to pop-up like there was a break point on that line. Something like: FooBar := Foo(Bar); SimulateBreakPoint; // Cause break point to occur in Delph...

Error "Cannot change Visible in OnShow or OnHide" in Delphi IDE

I have a very strange problem with the Delphi 2006 IDE. If the IDE is minimized, and the PC is locked. I return to the pc, unlock it and maximize the IDE, I sometimes get the error "Cannot change Visible in OnShow or OnHide". If this happens, I have to kill the IDE with the taskmanager. Is there anybody out there who has the same pro...

What is the difference with these two sets of code

What is the difference between these two pieces of code type IInterface1 = interface procedure Proc1; end; IInterface2 = interface procedure Proc2; end; TMyClass = class(TInterfacedObject, IInterface1, IInterface2) protected procedure Proc1; procedure Proc2; end; And the following : type IInterface1 ...

How to embed a browser object, other than IE<n>, in a Delphi application

Using the default TWebBrowser makes things easy to embed a web browser. Unfortunately the one that comes in by default is IE<n>. I'm wondering how does one integrate a Gecko or WebKit one. Are there VCL examples somewhere? If not, how would one go about doing it? Where's the best place to find the core for Gecko and/or WebKit in an em...

Using Length() with multi-dimensional dynamic arrays in Delphi

I am using a multi-dimensional dynamic array in delphi and am trying to figure this out: I have 2 seperate values for the first index and second index that are totally seperate of each other. As new values come I want to grow the array if that new value is outside of either bound. For new values x, y I check: if Length(List) < (x + ...