delphi

Delphi: how to use TObjectList<T>?

I need to understand how to use the generic Delphi 2009 TObjectList. My non-TObjectList attempt looked like TSomeClass = class(TObject) private FList1: Array of TList1; FList2: Array of TList2; public procedure FillArray(var List: Array of TList1; Source: TSource); Overload; procedure FillArray(var List: Array of TList2; Source:...

Custom drawing in TListview descendant.

I have a descendant of TListView that offers some additional features, such as sorting and ability to load itself from a TDataset. I now wish to extend this component further so that certain aspects of the drawing can be specified at the time items are added to the list view. I'm having trouble figuring out which procedure or procedur...

Is it possible to use the adoquery result as a string?

Im using the ado components to connect to an ms sql database. I know how to show the result of a query in db grid. But i want to store the results as string in an array for example. Is this possible or is there another way to use the query results? ...

Get Object Data from a class Procedure or Function?

Is there a way to get Object data from its class procedure or function without instantiate it? ...

Looking for a Delphi Gantt chart component

Hi, Does anyone have any experience with using a Gantt chart control in Delphi? I'm looking for a native VCL one but ActiveX would also do. I don't have too many requiremetnts other than it looking half decent and has very basic editing. thanks for any suggestions Edit: I am on Delphi 2009 ...

How do I make the Lazarus IDE look and work like Delphi 2007 or newer?

I've begun working with using Lazarus to make some simple utilities for my own use on Ubuntu 9.10. I know many people like the modular Delphi 7 layout, but I hate it. I find it annoying and disruptive. I dislike using Gimp for the same reason. I'd also prefer to have the Delphi 2007 palette menu. Is this possible within the latest versi...

Drawing and clearing the desktop canvas with Delphi

I'm trying to draw over the whole screen by using the desktop canvas and painting to it directly. The problem is I can't clear that desktop canvas. I've tried setting the canvas.pen.style to psNotXOR and draw over the old image but unfortunately, this is not reliable enough and some left overs are still present in some conditions. My ne...

Encolding error in the d2010

Hello I am testing Delphi 2010 and I was with the following mistake: Do I enter with this chain of characters "096 - Construção Ltda" and do I only move her/it for another variable and do look at him/it what leaves "096 - Construção Ltda", does anybody know how to find out that that??? Entrance base 001 Alcides João Pereira 002 Alvir...

Does Indy support raw TCP sockets on Windows?

I'm a C++ programmer, but my question is about the Delphi network socket library Indy. Essentially as Microsoft crippled raw sockets with WinXP SP2 so that TCP data cannot be sent over them, does this then also apply to Indy? One of my friends recommended it to me rather then using the WinSock API. If not, then is the only way to use r...

Persistent Objects in Windows XP/Delphi 7

Hi Folks: I am trying to make an AlarmSystem in Delphi 7, Windows XP. I have to register alarms in a Database (MS SQL Server 2000). But what if the server is down??? Well, I can imagine that I have to persist objects of TAlarm type. So, how can I do this? Maybe inheriting from TComponent??? Please, how can I do this?? Thanks a lot. I a...

Landscaping in Rave Reports using Delphi 7

I have an application that uses Rave Reports on Delphi 7. I want the reports to have its default display in landscape. How am I going to do it? Any suggestions would be very much appreciated. ...

How can I grab an image dragged from Firefox?

Based on this drag/drop article: http://delphi.about.com/od/adptips2005/qt/dropontimage.htm I'm trying to catch an image dragged from Firefox onto a TPanel, I've got something that nearly works, but when I go to copy the file (that I thought would be temporarily created), the file did not exist, what did I miss? procedure TformMain.For...

Recommended books/tuts/useful links on pascal programming language

Tried google, but could not find good enough book/tuts on pascal programming language.So what are your recommendations? thanks. ...

How to remove errors (red underlines) in D2007

I have a lot of errors in structure panel. The application compiles and run fine with Delphi 2007. But the code have much code that have red underlines. If I press Ctrl + leftclick on it it finds the original declaration. But it is still annoying to have all those errors. ...

How to manually invoke DSProxyGEN.EXE to generate Delphi DataSnap proxy client?

Hi, I am using DataSnap of Delphi 2010. There is a DSProxyGen.EXE utility to allow us generate proxy client unit. Does anyone how to consume this utility in command line to generate the proxy client without using TSQLConnection's context menu? ...

How to position a form before it shows?

Our application used to make use of a common base form that all forms were meant to inherit from. I'd like to get rid of it for a number of reasons, ranging from the need to police that everyone uses it to several annoyances relating to Delphi's VFI implementation. It turns out that the bulk of the features it offered can be done in othe...

How do I (or if I can't) use Variants on simple DLLs?

I want to expose some functionality of a internal object as a DLL - but that functionality uses variants. But I need to know: I can export a function with Variant parameters and/or return - or is better to go to an string-only representation? What is better, from language-agnostic POV (the consumer is not made with Delphi - but all wil...

FileExists timeout

Possible Duplicate: Faster DirectoryExists function? I want to check if some file exists on a network drive. But FileExists is too slow if drive is disconnected. How can I check it with some timeout? Examples are welcome. ...

RTTI: Can I Get a Type by Name?

Given a text string containing a type name, is there some way to get the appropriate type itself? I'm looking to do something like this: type TSomeType<T> = class // yadda yadda end; procedure DoSomething; var obj : TObject; begin o := TSomeType<GetTypeByName('integer')>.Create; // do stuff with obj end; I've looked at...

How to display data from a text file in a listview?

I want to get data from a text file to a listview. A sample text file contains: 0th member first=XXXXXXXX second=YYYYY000 1 first=XXXXXXX1 second=YYY1111 2 first=XXXXXX22 second=YYYY2222 3 first=XXXXXX33 second=YYYY333 4 first=XXXXX4444 second=YYY4444 Like that I want to get value of first to listview.items.caption and second to su...