delphi-2009

Compiling with Delphi 2009 from a command line under Windows Vista 64-bit

Has anyone succeeded to compile a Win32 GUI app with the command line dcc32.exe compiler, under 64-bit Windows Vista, without installing Delphi 2009? On our system it fails, with a message that the DFM files contain unknown 16-bit resources. This is usually an indication that the DFM files cannot be read. It works perfectly on all 32-bit...

Problem with Delphi 2009 and old-style object type

Hi, I've got a lot of older code that uses the old-style pascal object type that I'm trying to get working in Delphi 2009. It compiles, but there seems to be several problems dealing with virtual methods. It appears that this problem has already been reports on Quality Central: http://qc.embarcadero.com/wc/qcmain.aspx?d=71723 I was h...

Process for localization of Delphi 2009 app by volunteer translators?

I have a freeware scientific app that is used by thousands of people in nearly 100 countries. Many have offered to translate for free. Now that D2009 makes this easier (with integrated and external localization tools, plus native Unicode support) I'd like to make this happen for a few languages and steadily add as many as user energy w...

The .NET 'Type' class alternative in Delphi

I want to write in Delphi (2009 - so I have generic dictionary class) something similar to that C# code: Dictionary<Type, Object> d = new Dictionary<Type, Object>(); d.Add(typeof(ISomeInterface), new SomeImplementation()); object myObject = d[typeof(ISomeInterface)]; Any ideas? Thanks in advance, Hristo ...

Delphi 2009: How do I prevent frame children from spilling into host form?

Ever since I upgraded to Delphi 2009, I am having terrible experience with TFrame descendants. Basically, the child components of the frame spills into the host form as object and that causes name crash, class not found etc.. In the dfm, the older Delphi used have have the frame as inline and the child components as inherited. Delphi 20...

Delphi 2009 - Can an Interface Property Cause a Memory Leak?

I inherited an Intraweb app that had a 2MB text file of memory leaks as reported by FastMM4. I've got it down to 115 instances of one class leaking 52 bytes. A brief description of the bad actor is: TCwcBasicAdapter = class(TCwcCustomAdapter) protected FNavTitleField: TField; function GetAdapterNav(aDataSet: TDataSet...

AnsiString return values from a Delphi 2007 DLL in a Delphi 2009 application

I have a DLL compiled with D2007 that has functions that return AnsiStrings. My application is compiled in D2009. When it calls the AnsiString functions, it gets back garbage. I created a little test app/dll to experiment and discovered that if both app and dll are compiled with the same version of Delphi (either 2007 or 2009), there i...

How to remove duplicate records in grid ?

Hi, Good morning ! What is the best way to remove duplicate records from grid control? I use Delphi 2009 and devEx quantumGrid component. I tried looping through all the records and when a duplicate record is found then add it to list and apply filter on grid. I found this as time consuming logic. There are also two downsides of th...

Freeing Multiply-referenced Objects

This is another post about me inheriting an Intraweb app that had a 2MB text file of memory leaks as reported by FastMM4, where I've got it down to 115 instances of one class leaking 52 bytes each. The leaks are from a rather convoluted instantiation and handling of the class. Each instantiation of the class is needed to get the app to...

Problem with Check for updates in RAD studio

Hi, I installed Embarcadero RAD Studio (Delphi 2009). When the IDE ran for the first time, it downloaded updates and ran the MSI automatically. Accidentally I pressed cancel, instead of ok. So I thought of reopening the studio so that it may check for updates. But this time it didnot happen !! So, I used "Check for updates" from m...

How to recompile a specific unit from the VCL?

I want to apply a fix from QC to a Delphi 2009 unit (DBClient as it happens). I know I need to copy the unit to another directory and make the change to the copy. How do I then get Delphi to compile that unit and use it in favour of the DCU that already exists? ...

Delphi 2009 in-process com. Error message - 'Os function failed'

Hello I have created an in-process com server using Delphi 7, it worked perfectly on windows XP and all windows pre-vista. After upgrading to windows vista, all interfaces are available except this only one interface that produces the following error message : 'Os function failed'. Microsoft Developers Guide states that the Abstra...

how to convert byte array to its hex representation in Delphi

Hi, I have TBytes variable with a value [0,0,15,15]. How can I convert it to "00FF" ? I dont want to use loops, bcoz this logic to be used in time intensive function. (I tried using BinToHex, but I could not get it working with string variable.) Thanks & Regards, Pavan. ...

Dataset's TBytes column and SQL VarBinary field combination

Hi, select convert(varbinary(8), 1) in MS SQL Server produces output : 0x00000001 On assigning the above query to dataset in Delphi, and accessing field value, we get byte array as [1, 0, 0, 0] . So Bytes[0] contains 1. When I use IntToHex() on this bytes array it would result me value as "10000000" . Why is IntToHex considering it...

How do I make TProgressBar stop lagging?

I've got an app that runs a long set of operations, and I'm trying to use a TProgressBar to keep track of what's going on. I set a number of steps, and call .StepIt to increment the progress bar. Problem is, it doesn't keep up very well. Instead of jumping directly to the correct position, it seems to like to slide gradually up to it....

TGenericClass<T> containing a TObjectList<T> doesn't compile

Hi, I'm trying to write a generic class which contains a generic TObjectList< T > which should contain only Elements of TItem. uses Generics.Collections; type TItem = class end; TGenericClass<T: TItem> = class public SimpleList: TList<T>; // This compiles ObjectList: TObjectList<T>; // This doesn't compile: Compiler...

Why doesn't THashedStringList ignore duplicates?

I have the following code: var sl: THashedStringList; begin sl:= THashedStringList.Create; sl.Duplicates := dupIgnore; sl.Add('12345'); sl.Add('12345'); sl.Add('12345'); sl.Add('12345'); sl.Add('12345'); sl.Add('12345'); sl.Add('12345'); ShowMessage(IntToSTr(sl.Count)); end; But when I see sl.Count, it gives me 7...

Fade all other windows of an application when a dialog is shown?

Hi, How to dim / fade all other windows of an application in Delphi 2009. Form has an AlphaBlend property, but it controls only transparency level. But it would be nice if we can have something like this (Concentrated window) . Even stackoverflow.com does that, when we try to insert a link/ image etc in the post. How can we achieve ...

Delphi TClientSocket replacement using winsock2 and IOCP?

Is there such a thing? It needs to be asynchronous (no Indy). ...

Adding or inserting an item to a TListView always adds it to the end when GroupView is Active

Hi, In Delphi 2009 : When TListView's GroupView is Active, adding or inserting an item to a TListView always adds it to the end of the list, regardless of Index specified as param. When GroupView is set to false it adds it at the specified index. But when it is true, this behavior is not seen. ListView2.Items.Insert(1) The above ...