delphi

Why are Delphi objects assigned even after calling .Free?

In Delphi, why does the Assigned() function still return True after I call the destructor? The below example code will write "sl is still assigned" to the console. However, I can call FreeAndNil(sl); and it won't be assigned. I've been programming in Delphi for a while, but this never made sense to me. Can someone explain? program P...

How to create a button with drop-down menu?

Is there a way to show IE/Firefox Back button style, dropdown menu button? ...

Code documentation for delphi similar to javadoc or c# xml doc

I need a code documentation tool similar to javadoc or c# xml doc for delphi code. What is the best tool? I prefer a technology, which is in the future compatible to the Microsoft sandcastle project. ...

Any active Bold for Delphi users ?

What are you using as a persistance framework when programming in Delphi? If the application is growing it soon became really complicated to handle the model in SQL ? Bold is a persistance framework for Delphi win32 that really deserve more attention. I use it daily and using OCL instead of SQL to get data from the database saves a lot o...

Get string return value from C DLL in Delphi

I have a legacy DLL written in C that contains a function that returns a string, and I need to access this function from Delphi. The only info I have about the DLL is the VB declare for accessing the function: Public Declare Function DecryptStr Lib "strlib" (Str As String) As String I've tried the following without success: Declarati...

Delphi to .NET + C#

Hi, I've been a Delphi (D7) developer for many sometime already, I've always been wondering about the .NET + C# stuffs. What I mean are about not the "Delphi for .NET" or "Oxygene" tech/plugin, but clean .NET/C#. How much different is it from Delphi? And some other questions... Is Mono/SharpDevelop (any others that I should know of?)...

How do I put GIF/PNG/... image on a BitBtn in Delphi?

I'm using Delphi 2007. How can I put a GIF/PNG image on a BitBtn component? (Preferably, with alpha transparency supported) ...

Best Way to Replace a Visual Component in Delphi

In a Delphi Form, I would like to replace one visual component with another. Example: I want to replace a Panel component with an ElPanel from a 3rd party package. I would like all identical properties and events of the first component to be transferred to the new one, and all the components that belong to the first component (e.g. Too...

Duplicating components at Run-Time

Is there a simple way to duplicate all child components under parent component, including their published properties? For example: TPanel TLabel TEdit TListView TSpecialClassX Of course the most important factor, it should duplicate any new component which I drop on the TPanel without modifying the code under normal circumstances....

What is the correct way to check if a value is a date/number in Delphi

What is the correct way to check if a value is a date/number in Delphi? I know other languages have functions like isDate and isNaN, but what is the Delphi equivalent? at the minute I have this function isNumeric(s1:string):boolean; begin // will throw exception if its not a number // there must be a better way to do this!! ...

Will you use Delphi Prism

CodeGear announces that their Next .Net product which is known as Delphi Prism Will be RemObjects's Oxygene. Oxygene has many nice features that not found in Delphi or C#, and I think it will be a more effective solution for .Net than Delphi .Net previous releases, but it's uses Visual Studio IDE instead of Delphi IDE. which has some co...

WARNING. Duplicate resource in Delphi 7, Infopower 4000

[Error] WARNING. Duplicate resource(s): [Error] Type 2 (BITMAP), ID TWWDBRICHEDITMSWORD: [Error] File C:\Borland\Delphi7\ip4000vcl7\LIB\wwrichsp.RES resource kept; file C:\Borland\Delphi7\ip4000vcl7\LIB\wwrichsp.RES resource discarded. I have searched the code for same named objects, like objects. Can anyone give me a clue w...

What's wrong with this Delphi function?

Delphi 2009 complains with an E2283 error: [DCC Error] outputcode.pas(466): E2283 Too many local constants. Use shorter procedures Delphi 2007 compiles just fine. I can't find an abundance of local constants, it's a short (500 line) unit. Do you see any abundance of constants or literals I can address? procedure TOutputCodeForm.FormCre...

Multiselect listbox binded to database in Delphi 6.

I'm using Delphi 6, and I want a database binded list box with multiselect. I found three types of List boxes: TListBox, TDBListBox and TDBLookupListBox. As far as i can understand, TListbox is not binded to database. TDBListBox and TDBLookupListBox can't be multiselected. Is there a way to get a multiselect listbox binded to databa...

Best way to find if a string is in a list (without generics)

I want do something like this: Result = 'MyString' in [string1, string2, string3, string4]; This can't be used with strings and I don't want to do something like this: Result = (('MyString' = string1) or ('MyString' = string2)); Also I think that creating a StringList to do just this is too complex. Is there some other way to achi...

How to play a wav-File in Delphi?

Which functions are available within Delphi to play a sound-file? ...

Is it possible do Declare a constant array that includes another constant array?

I want to do something like this: const MyFirstConstArray: array[0..1] of string = ('Hi', 'Foo'); MySecondConstArrayWhichIncludesTheFirstOne: array[0..2] of string = MyFirstConstArray + ('Bar'); Basically I want the following result: MyFirstConstArray -> ('Hi', 'Foo'); MySecondConstArrayWhichIncludesTheFirstOne -> ('Hi', 'F...

How to use JEDI TJCLHashMap classes?

I'm trying to use TJCLHashMap family of classes, but apparently this class has no useful public methods. All methods are "protected". How to use this class? Although JCL comes with some samples, I seem to miss something. A basic example would be great. ...

Delphi 2009 and Firebird 2.1 = Full Unicode?

Has anyone started making Unicode Apps or converting Existing Apps into Unicode? How are you tweaking Firebird to have the least problems, especially the CHARSET attribute? Is there any problem encountered? Any thing else that I should be aware of? I'm just preparing myself so that I get less surprises, before jumping onto the Unicode...

how can i make a "Surround" type Delphi Template?

i'm migrating my app to delphi 2009. my app must still use a lot of AnsiString. during migration, i find myself always converting: abc := def; into: abc := string(def); or abc := TDeviceAnsiString(def); i know i should be able to do this with templates but i find templates--although powerful--are not so easy to get working. h...