delphi-2010

JEDI controls always recompile

I've just noticed that whenever I do an incremental compile (ctrl-F9) of any of my Delphi 2010 projects, all JEDI units referenced in my project are recompiling although they have not been changed in any way. In fact, if I create a new project, drop a JEDI control on the form and compile, I see all JEDI dependencies getting recompiled. ...

How retrive full path with file name or folder name from ShellTreeView/ShellListView

Sir, I create a project, where I use ShellTreeView, ShellListView, ListView. Now I drag folder from ShellTreeView and files from ShellListView. Now I want to retrieve file name including full path (like: c:\abc\file.txt) or folder (like C:\abc). For retrieving the path I use a command button and a text box. What will the code? Dev ...

Delphi - RTTI info about methods in records

hello, how to extract RTTI info about methods in Delphi records? is it possible by using new Rtti unit? ...

Delphi: RTTI for indexed properties in 2010?

Please forgive the verbosity of the following code example. Using Delphi 2009, I created the two classes TOtherClass and TMyClass: TOtherClass = class(TObject) public FData: string; end; TMyClass = class(TObject) private FIndxPropList: Array of TOtherClass; function GetIndxProp(Index: Integer): TOtherClass; procedure Se...

Delphi 5 to 2010

I used same function ( OneWayEncrypt(edit1.Text) ) in Delphi 5 and 2010. Why the results are different? (Or how can I give the same results from Delphi 2010?) uses Sysutils, Windows, Dialogs, classes; function OneWayEncrypt(AStr: string): string; PROCEDURE CalcCRC32 (p: pointer; ByteCount: DWORD; VAR CRCvalue: DWORD); implementatio...

Delphi 2010: whatever happened to TRTTIConstructor?

I've got two questions (of which at least one is regarding RTTI in D2010 and dynamic instancing) I was reading what appears to be the foils for a conference talk by Barry Kelly, and found on p. 13 something that looked really interesting: TRTTIConstructor.Invoke. In an adjacent bullet point, one finds "Dynamically construct instances w...

Delphi 2010 - Why can't I declare an abstract method with a generic type parameter?

I am trying to do the following in Delphi 2010: TDataConverter = class abstract public function Convert<T>(const AData: T): string; virtual; abstract; end; However, I keep getting the following compiler error: E2533 Virtual, dynamic and message methods cannot have type parameters I don't quite understand the reason why I can't d...

Small Command line scripter (like Autocad commands) one line editor

Basically I don't know from where to start, I need to add a line script for my application that is not so complicated, just to execute pre-defined commands, for instance: command> New Invoice --> create new invoice command> customer profile --> open customer form where cust id = CustID command> run End-Of-Day - run the end of day p...

How test a Delphi app with Application Verifier 4.0?

I download the Application Verifier 4.0 to test my App for check if could have problems on Vista/7. I run from Delphi 2010 debugger, and stop in CPU view. Obviously, I don't understand anything about assembler!. So, I try running directly from the windows explorer, and the App die. (In fact, I don't understand well what exactly will d...

Can the Delphi 2010 IDE add relative search paths to a project.

We have recently upgraded from Delphi 2009 to 2010. One of the things in 2009 that suited us well was when you added a search path to a project (via Project -> Options -> Delphi Compiler -> Search Path) and used the browse dialog, the IDE would add in the relative path. In 2010 this seems to have changed to absolute paths. Is there ...

Converting an AnsiString to a Unicode String

I'm converting a D2006 program to D2010. I have a value stored in a single byte per character string in my database and I need to load it into a control that has a LoadFromStream, so my plan was to write the string to a stream and use that with LoadFromStream. But it did not work. In studying the problem, I see an issue that tells me t...

Delphi: RTTI and TObjectList<TObject>

Based on one answer to an earlier post, I'm investigating the possibility of the following design TChildClass = class(TObject) private FField1: string; FField2: string; end; TMyClass = class(TObject) private FField1: TChildClass; FField2: TObjectList<TChildClass>; end; Now, in the real world, TMyClass will have 10 differe...

Delphi 2010 DeHL Serialization XML and custom attribute : how it work ?

Hi all, I try to investigate DeHL with Delphi 2010 custom attribute and I get problem. TAppParamTest = class public User: string; Password: string; end; TAppParam = class private FTest: TAppParamTest; public constructor Create; destructor Destroy; override; property Test: TAppParamTest read FTest w...

How to sort a QuantumGrid on data from a different column

Is there a way to sort Devexpress QuantumGrid rows on data from a different column other than the one whose header has been clicked? For example, when the header of column A is clicked the rows of the grid are sorted on the data from column B. Visually it should still appear that it is column A that has been sorted as the sort glyphys wi...

Problems upgrading MySQL application from Delphi 2006 to 2010

I upgraded my Delphi to 2010 version and I tried to open and run application written in Delphi 2006. The app is using mysql by dbexpress with libmysql.dll and a second driver found somewhere on the Internet. I can't run it on 2010. I'm always getting "missing libmysql.dll library". I tried to get new version of it but it didn't help. C...

How make DBLookupcombobox has a Windows 7 Look with RAD 2010?

I'm using RAD 2010 on windows 7 and all visual components looks normal (Edit, DBCombobox, for example) but the dblookupcombobox has the same border theme from Windows XP. I can't find how make it's looks like the other components. Anyone has any idea of how i can make this? Thanks PS: Sorry by the bad english. ...

List local printers

I am using this routine to list the local printers installed on on a machine: var p: pointer; hpi: _PRINTER_INFO_2A; hGlobal: cardinal; dwNeeded, dwReturned: DWORD; bFlag: boolean; i: dword; begin p := nil; EnumPrinters(PRINTER_ENUM_LOCAL, nil, 2, p, 0, dwNeeded, dwReturned); if (dwNeeded = 0) then exit; GetMem(p,dwN...

Delphi's OTA: is there a way to get active configuration while building (D2010)?

I can ask Delphi to build all configurations at once - by clicking on "Build configurations" and invoking "Make" command: This will build all configurations, one after another. The problem is that we have an IDE expert, which must react on compilation events. We register IOTAIDENotifier80 to hook events. There are BeforeBuild and Aft...

Unit finalization order for application, compiled with run-time packages?

I need to execute my code after finalization of SysUtils unit. I've placed my code in separate unit and included it first in uses clause of dpr-file, like this: project Project1; uses MyUnit, // <- my separate unit SysUtils, Classes, SomeOtherUnits; procedure Test; begin // end; begin SetProc(Test); end. MyUnit look...

Delphi 2010 - Decode Base64 encoded image from XML doc

I am trying to decode a base64 encoded EMF image from an XML document in my application and render it on screen, however, it never seems to appear. If I copy/paste the data from the XML document into Notepad++ and use the Base64 Decode option and save the file as a .emf it opens fine in mspaint. So I think the issue is how I am decoding...