delphi-2009

DB-connection in separate thread - what's the best way?

I am creating an app that accesses a database. On every database access, the app waits for the job to be finished. To keep the UI responsive, I want to put all the database stuff in a separate thread. Here is my idea: The db-thread creates all database components it needs when it is created Now the thread just sits there and waits for ...

Delphi dbExpress and Interbase: UTF8 migration steps and risks?

Currently, our database uses Win1252 as the only character encoding. We will have to support Unicode in the database tables soon, which means we have to perform this migration for four databases and around 80 Delphi applications which run in-house in a 24/7 environment. Are there recommendations for database migrations to UTF-8 (or UNICO...

How to use external fonts?

Hello, Is it possible to use a font directly from resources in Delphi and how? I have a problem with the very first steps.Example I cannot include Segoe UI Light font in resources of a project,an exception occurs.And that is only if the file's extension is 'ttf'. If the written above is not possible then how do I use an external font ...

How to properly access query-results created in background thread?

I want to execute a database query in a background thread. The OmniThread library will help me with all the thread stuff, but there is one thing I don't understand so far: Every thread needs a separate database connection. The background thread therefore creates the DB connection, creates the query and then executes it. Now I could acc...

Casting anonymous procedures in Delphi 2009

The following code (constructed only to demonstrate the problem) compiles and works in Delphi 2010. In Delphi 2009, compiler fails with "E2035 Not enough actual parameters". program Project50; {$APPTYPE CONSOLE} uses SysUtils; type TMyProc = reference to procedure(param: integer); var a: TProc; b: TMyProc; begin b := proc...

How to fire KeyPreview Event when form has a TActionMainMenuBar

When I set the property KeyPreview = TRUE on my main form (MDI Parent) the OnKeyDown, OnKeyUp or OnKeyPress events don't get fired. When pressing keys, I can navigate the main menu (TActionMenuBar). It seems the menu bar has the control over the key events. How can I fire an event, when the user is pressing a key (e.g. the VK_RETURN key...

Relative paths in Delphi projects and ITE in particular.

I've a bunch of projects with some common libraries in a SVN repository. The repository has some branches for in-production versions. For this reason (checking out several versions on one computer, and minimizing swap time), I tried to configure all projects as much as possible with relative paths within the repository. (....\libraries...

Delphi Dynamic Menu Items

I have a popup menu that has a few items in it. Option 1 - Sub1 - Sub2 Option 2 - Sub1 - Sub2 Option 3 - Sub1 - Sub2 I want to be able to add a Sub sub menu to Option 3 sub2 so it would look like: Option 1 - Sub1 - Sub2 Option 2 - Sub1 - Sub2 Option 3 - Sub1 - Sub2 - Dynamic Item1 - Dynamic Item2 - Dynamic It...

Compile all projects hotkey

Hello, I have two projects in a project group that share same units(mostly all).I use both projects in order to test something I've written. The problem: When I change a unit that is used by both projects and run the current project,the other one uses the old code in that unit(because its not compiled). The only possibility I know to ...

Delphi Enterprise: how can I apply the Visitor Pattern without circular references?

With Delphi 2009 Enterprise I created code for the GoF Visitor Pattern in the model view, and separated the code in two units: one for the domain model classes, one for the visitor (because I might need other units for different visitor implementations, everything in one unit? 'Big ball of mud' ahead!). unit VisitorUnit; interface use...

How do I catch a VK_TAB key in my TEdit control and not let it lose the focus?

In my TEdit field I have text in the form <number1>..<number2>. My idea is: When a user enters the control using TAB from another control, number1 gets selected. When my TEdit control has a focus and user presses TAB again, I want the number2 to get selected and number1 to be deselected. And if current caret position is at the place ...

Adding Properties to a Frame descendant

I'm pretty new to Delphi even though I used to use it many years ago (ver 2) so the Frame concept is something new to me. I understand that they work simular to Forms in that that they have an associated DFM file and are an easy way to create components (without actually creating a component, I do understand the difference between a comp...

Delphi - Proper way to page though data.

...

Capturing a 'delete' key press

Hello, I can't figure out how to capture the delete key press. I found out that in ASCII code table, it is at 127 place, but if (Key = #127) then got me nowhere. Then i checked the value of VK_DELETE which was 47. Tried to use that, but it didn't work. The KeyPreview := true is set in my form. I tried to add the ShowMessage(IntToSt...

Using Records with Delphi web services

I'm trying to use records with web services application in Delphi 32, the records defined as TMyRec = record Val1:integer; Val2:string; end; TMyClass = class(TRemotable) private fMyRec:TMyRec; published property MyRec:TMyRec read fMyRec write fMyRec; end; ITMyService = interface(IInvokable) ['{6283B8DA-C567-4814-906E-32172...

Problem with Delphi 2009

i have a problem with Delphi 2009 when i am trying to execute rave with massage Access Violation at address 0040DF40 in module 'HDMS.exe" Read of Address 00200050 and another massage list index out of bounds (-1) this problem happened when i am trying to use the application with windows XP and does not happen with windows NT. what shout...

Is there a way to change the default EXE icon in Delphi

Embarcadero just released a whole bunch of neat looking icons that I'd like to use to make my Delphi 7 and 2009 apps look fancier. Is there a setting (or hack) in those IDEs that lets me change the default exe icon? ...

Using [delphi] MadExcept errorhandling with MS Echange Server 2007

I currently use madExcept.MailAsSmtpClient to send my bug reports. However a couple of large clients have upgraded to Exchange Server 2007 and we can't get the SMTP support for our app configured (the app runs on individual workstations so the messages aren't all coming from one IP. We can configure an authenticated account in exchange a...

Delphi - ListView Question

Is there a ListView (ListBox) or similar component that allows me to easily drop another component in a specific column. (Multiple columns)? Like a checkbox, button or drop down list or all the above. (It would be nice to be able to sort via the header also) If not does anyone know of a resource on how to custom draw something like thi...

Delphi 2009 - Strip non alpha numeric from string

I've got the following code, and need to strip all non alpha numeric characters. It's not working in delphi 2009 ` unit Unit2; //Used information from // http://stackoverflow.com/questions/574603/what-is-the-fastest-way-of-stripping-non-alphanumeric-characters-from-a-string-in interface uses Windows, Messages, SysUtils, Variants, C...