delphi

How To Get The Index and Caption of a ActionClient ChildItem Added At RunTime

This adds an ActionClientItem at runtime from a stringList: var ActionClient: TActionClient; ChildItem: TActionClientItem; if FileExists( ARecentFilesFilename ) then begin ARecentFilesList.LoadFromFile( ARecentFilesFilename ); // remove any duplicates RemoveDuplicates( ARecentFilesList ); for i := 0 to ARecentFilesList.Count...

How do I make a memo column on a DX grid show partial words?

I've got a TdxDBGrid that's displaying some information retrieved from a database query. One of the columns is a Memo column, (TdxDbGridMemoColumn,) which is necessary because the data in the field it's bound to comes out of the database as type TEXT, not CHAR or VARCHAR. Problem is, the memo column likes to display whole words, and if...

Deleting IWTreeViewItems causes exception on form release

On my form I have a IWTreeView and two buttons. One button deletes some IWTreeViewItems, the other releases the form: procedure TIWForm1.IWButton1Click(Sender: TObject); begin IWTreeView1.Items[0].Subitems.Clear; end; procedure TIWForm1.IWButton2Click(Sender: TObject); begin Release; end; Releasing the form after deleting the IWT...

how to retrieve text from website text boxes

how can i retrieve text from a web sites text boxes in delphi for example suppose i type ''tiger'' in google's search box how do i retrieve text from that search box would wm_gettext or getwindowtext work? i am using delphi 7 ...

How can I detect a debugger or other tool that might be analysing my software?

A very simple situation. I'm working on an application in Delphi 2007 which is often compiled as 'Release' but still runs under a debugger. And occasionally it will run under SilkTest too, for regression testing. While this is quite fun I want to do something special... I want to detect if my application is running within a debugger/reg...

How to create a dynamic array of single as a property in a class

I'm currently creating a class to write and read arrays Opening a file, closing a file all works well. Also, I'm able to write an array towards a bin file. But returning an array from the class is a bridge to far. So far, ther're 2 issues where I'm not able to work around 1) in the public section function ReadArrFromFile : ar...

Delphi: Codecompletion to override basemethods

In a class declaration, you can press Ctrl+Space to get a list of virtual methods in the baseclass that you can override. This list seems to be very limited, though. Ex. TMyBaseClass = class(TInterfacedObject) protected procedure mymethod; virtual; end; TMyClass = class(TMyBaseClass) protected {Ctrl+Space here...} end; ...

[DCC Error] E2161 Error: RLINK32: Too many resources to handle. Delphi Error

Hi, I get the below error when I try to link resources in a dll. [DCC Error] E2161 Error: RLINK32: Too many resources to handle. Number of resources are more than 10K. I am not sure, if there is any limit on the size of resource names in a dll. https://forums.codegear.com/message.jspa?messageID=58473 Is there any way to add more ...

Does anyone know about issues between Citrix and Delphi 2007 applications? (And perhaps other development languages?)

The situation is simple. I've created a complex Delphi application which uses several different techniques. The main application is a WIN32 module but a few parts are developed as .NET assemblies. It also communicates with a web service or retrieves data from a specific website. It keeps most of it's user-data inside an MS Access databas...

Assorted list of what's new in Delphi [Language, RTL, VCL]?

Hi gents, As someone who's been stuck at the older versions of Delphi and upgraded to D2010 lately, I figure I still use the language, RTL and VCL features from the D5 era and refrain from using these new features as the documents on those are somewhat decentralized around the blogosphere. So I'd like to ask if there was an assorted li...

TForm property that's an array (or collection) of TFrame descendants

I am exploring this subject again, from a slightly different angle than before: I have TForm descendant which is used in a couple of other components as a dialog, that I'd like to add as a property an array of counted TFrame descendants. What multi-item property approach should I use for this? (Array, TList, TObjectList, TCollection,...

Using TCollection with an already-defined class

(Note: This is somewhat related to my last question). I am new to using TCollection in Delphi, and am still wrapping my head around the various ways to handle one-to-many class/property-item relationships. Exploring TCollection and TCollectionItem, I ran into a couple questions: 1) Is it possible to use TCollection or TOwnedCollectio...

How to register a 64-bit dll (on a 64-bit OS) from a 32-bit application

I currently use the following function to register a dll that handles context menu calls. function RegisterLibrary(szLibrary: String): Integer; var hLib: THandle; drs: TDllRegisterServer; begin // Attempt to load the library hLib := LoadLibrary(PChar(szLibrary)); // Handle check if IsHandle(hLib) then begin // Get the reg...

How do I fix inconsistencies when converting file dates to/from TDateTime

I'm caching files locally in my 3 tier app. To check whether to read the file from the local cache or from the server I compare file dates. I've found that there when converting file dates to TDateTime and viceversa there are inconsistencies and values that should match rarely do. Here's some code that demostrates the problem procedure ...

How to detect Windows Logon event ?

How do you detect Windows logon event? And how do you initiate a user logon from a Windows service? I'm trying to write a piece of code that will detect logon events and log another one automatically. ...

Easy way to modify progress bar in existing Delphi code?

Hello, I am using demo code which compresses all files in folder. However, it's progress bar displays not total progress, but progress for every file. Is there any easy way to modify code so progress bar would display total progress and not progress for every single file? procedure DoProgress(Sender: TObject; Position, Total: Integer)...

Delphi issues on windows 7 x64 ?

Hello I searched around but I couldn't find a straight answer to these questions, only bits and pieces: if I install windows seven x64, 1 - will I be able to use delphi 2007+ as I'm used to aka start it, code in it, debug in it, compile in it ? I've seen the debugger issue and the hex edit workaround. 2 - will my application compiled...

How convert null-terminated string to an AnsiString ?

I have some code that compiles fine with D7 but fails with D2010. Obviously it is an Unicode issue: The compile error is: E2251 Ambiguous overloaded call to 'StrPas' Here is the whole procedure: procedure GetVersionInfo; type PLangCharSetInfo = ^TLangCharSetInfo; TLangCharSetInfo = record Lang: Word; CharSet: Word; end; ...

[Delphi] Compress all files but skip one

Hi, I am zipping directory which has sub directories and there are few files which I don't need (in those sub dirs), can you modify the following script so it would skip certain files I want? Can pay up to $20 to PayPal for your hard work :-) procedure DoProgress(Sender: TObject; Position, Total: Integer); procedure DoCompressFile(Sen...

Questions every good Delphi developer should be able to answer?

Following the spirit of these questions: How to Recruit Great Developers? Questions every good .NET developer should be able to answer? ...it would be interesting to know recommendations or advice for hiring a good Delphi developer. Some time ago Steve Trefethen published a series of great articles: Delphi IDE Wisdom Delphi RTL a...