delphi

LIB file output locations for Delphi 2009 packages.

When building a Delphi 2009 component package, how do you specify which directory should contain the resulting .hpp and .lib files needed for C++ Builder users? ...

General Question for messageboxes

messagebox (handle, 'do you really want to exit?', 'are you sure?', 1); in this button there are two things, what the user can do. ok and cancel. what code do i have to write, that the button closes the program at "ok" and ends the dialog, when pressing cancel? ...

How to make a click- and see-through 'always on top'-window

I want to display an semi-transparent always-on-top window with some information, but I do not want this window to take input or receive focus. All mouse-clicks should go to the underlaying window. I remember seeing this in a shell-replacement application years back, but I can't remeber witch. Any Ideas how to achieve this effect with ...

In what order does Class Completion put its results?

Example: I create a new unit, declare a class with several methods like constructor, destructor, method1, method2, method3 in that order and then hit Ctrl-Shift-C. The IDE creates all the method bodies automatically, but the order is mixed up and not as it was declared in the interface section. Now, this is not a problem, but is there a...

How to make 'always-on-bottom'-window

Does anybody know how to make a 'always-on-bottom'-windows, or a window pinned to the desktop? It should receive focus and mouseclicks, but should stay at the bottom of the Z-order. It would also be great if it could stay on the desktop even when user do a minimize all or show desktop operation. Both delphi and c# solutions (or partial ...

Does Delphi 's REGION directive support a default 'folded' attribute?

I can't seem to find the option to make Delphi collapse a {$REGION}...{$ENDREGION}-block by default (by which I mean : directly after opening a file). Is it actually possible? Thanks in advance. ...

Adding a unit to the Interface uses clause rather than the Implementation uses clause

When using Delphi: If I have a unit that is filled with constants like... Unit AConsts; Interface Const Const1 : WideString = 'Const1'; Const2 : WideString = 'Const2'; Const3 : WideString = 'Const3'; Const4 = 100; Const5 = 100; Implementation end. and I want to use this unit from another unit, is there any dif...

Check class name

Hi all; I don't know OWNER object class name. So I must check everywhere in my codes like that : if TObject(OWNER) is TFirstClass then begin TFirstClass(OWNER).FirstFunction; TFirstClass(OWNER).SecondFunction; ... end else if TObject(OWNER) is TSecondClass then begin TSecondClass(OWNER).FirstFunction; TSecondClass(OWNER).Sec...

What is the best way to embed Firebird Installation in the Installer for my app?

My app has its own installer but I have to guide my users to install Firebird on their own. I'd like to install it automatically. Thanks. ...

What is Codepage 0?

I'm using the Delphi function StringCodePage I call it on a string returned by a COM function (Acrobat Annotation getContents - see my other posts) and it returns 0. What is 0? Ansi? Thanks ...

Looking for a PDF file parser.

Does anyone know of a PDF file parser that I could use to pull out sections of text from the plaintext pdf file? Specifially I want a way to be able to reliably pull out the section of text specific to annotations? Delphi, C# RegEx I dont mind. ...

Delphi TeeChart only showing one record from dataset

Using Delphi Steema TeeChart component, if I link a BarSeries to a dataset using the user interface, it shows up fine, but if I do it using code (which I need to), it's only showing one bar, even when I have several records in the database. What am I doing wrong? Code: var i:Integer; Bar:TBarSeries; begin ADataSet.Close; AD...

Why is GenTLB renaming symbols (appending '_')

I am using GenTLB.exe to compile a ridl file to .tlb and _TLB.pas files. In the resulting _TLB.pas file, there are hints that it has renamed a number of symbols by appending an underscore to the end of the name. A sample of the hints is: // Errors: // Hint: Symbol 'Assign' renamed to 'Assign_' // Hint: Enum Member '_amStretch' of ...

Measuring code coverage in Delphi

Is there any way to measure code coverage with DUnit? Or are there any free tools accomplishing that? What do you use for that? What code coverage do you usually go for? Jim McKeeth: Thanks for the detailed answer. I am talking about unit testing in the sense of a TDD approach, not only about unit tests after a failure occured. I'm inte...

Delphi: how to automatically remove unused vars ("Variable 'x' is declared but never used" hint)

Is there any tool (preferably freeware) that can analyze Pascal/Delphi syntax and automatically remove unused vars? In my case, I'm working with a very large Delphi code base, and the compiler hints report over one thousand cases of "Variable 'x' is declared but never used". I would take hours to remove them by hand, and I might make e...

TStringList as field of object does not work

uses Classes, SysUtils; type TMyObject = class (TObject) private Fsl: TStringList; public constructor Create; destructor Destroy; override; end; implementation constructor TMyObject.Create; begin Fsl := TStringList.Create; end; destructor TMyObject.Destroy; begin FreeAndNil (Fsl); inherited; end; I get an ...

PNGs in Delphi 2009 Imagelists and Images

D2009 introduces PNG support for Images and Imagelists. However... I have an imagelist containing png images with alpha. I want to place one of these on a form using a TImage. How do I do this and get the image nicely composited? As an example of the problem I'm facing the code below fails to work correctly, and produces the effect sh...

Are there any static code analysis tools for Delphi/Pascal?

Are there any static code analysis tools for Delphi/Pascal? I have seen plenty of options for C++ and .NET, but nothing for Delphi/Pascal. Ideally something that could be integrated into a continuous integration system. ...

Where can I find a photo browser or carousel control for Delphi?

Are there any good image, photo browser or carousel controls for Delphi? I would prefer something free if available. ...

Where can I find a map control for Delphi?

I am trying to build an option in a application that let user see a map. This map must be editable, and tag enabled. It should also be possible to see sub regions in different colors, and highlight the one under the mouse. ...