delphi

Painting TPaintBox during Drag&Drop with DragImage

In my application (Delphi 2007) I want to drag items from a ListView to a PaintBox and highlight corresponding areas in the PaintBox's OnPaint handler. However I always get ugly artefacts. Do you have any advice how I can get rid of them? Test project: Just create a new VCL application and replace the code in Unit1.pas with the followin...

Draw and manipulate shapes at run time

What's the best way to draw shapes interactively at run time using Delphi? I need to be able to select, drag and resize the shapes. This will be used to mark up existing images and documents. This looks like a good starting point, but I'm wondering if there's a more complete library (preferably free) available that will save some time...

Is Delphi generic TInterfaceList possible?

In Delphi 2010, I have defined a generic TInterfaceList as follows: type TInterfaceList<I: IInterface> = class(TInterfaceList) function GetI(index: Integer): I; procedure PutI(index: Integer; const Item: I); property Items[index: Integer]: I read GetI write PutI; default; end; implementation function TInterfaceList<I>.GetI(inde...

Ok to use VirtualProtect to change resource in Delphi?

I'm working on a simple localization effort in D2010. I'm handling all strings on forms because ETM seems like overkill for my needs, as did other 3rd party tools... (although I'm not so sure at this point!) Is the code below for changing the Const.pas strings considered safe to change the button labels on standard message boxes? proc...

Why does ShGetFolderPath return nil when the folder exists on some Vista pc's

While testing our apps we found that using ShGetFolderPath to return the AppData path the function returns nil even though the folder exists on a test PC. On the development PC ShGetFolderPath returns the AppData path with no error. The development PC and the test PC are running Vista. function GetShellFolder( ID: Cardinal; Create: Bo...

Framework for Delphi similar to Castor

Can anyone suggest: a framework for Delphi for work with XML / XSD like the one that makes Castor for JAVA? Borland XML Data Binding does not offer - he is not flexible. ...

Differences between visual component library(vcl) and WinApi

Is there any difference between using vcl components in Delphi and WinApi functions to create gui application. ...

Delphi 2009 - Detect if component installed

Hi there, I got some code that I share with another developer. I have a nice debugging module which I leave through out the unit tests but he doesn't have this, so it's a battle of adding and remove the code constantly. Would be nice if there was a way we could use a condition (much like Delphi version or Unicode) like {$IfDef MYCom...

copyright free collection of resource images for Delphi menu items and toolbar buttons

Every time I need to create a menu or toolbar with actions I end up collecting some images extracted from different application and hand tuning them with the image editor. This is time consuming and boring (eventhough I admit that might be a refreshing break in some ocasions). Do you know of any collection of such images? I would like ...

Set Debugger Language Exception (to ignore) in Build Configuration

In Tools | Options | Debugger Options | Language Exceptions it's possible to ignore specific Exception types. Is it possible to do define this per project? Eg in the Debug Build Configuration (Delphi 2009 and/or 2010)? /Edit: Reported in QC ...

Add calculated column with checkboxes to datagrid

In my application I have a TcxGrid (devexpress datagrid) that displays the data returned from a stored procedure. Now I would like to add a column showing checkboxes from which the values cannot come from the database but are calculated internally. When the checkboxes are clicked, some internal logic needs to be triggered. Any suggestio...

How to track down access violation "at address 00000000"

I know how to create a .map file to track down access violation errors when the error message includes an actual address. But what if the error message says Access violation at address 00000000. Read of address 00000000. Where do I start looking for the cause of this problem... ? ...

Can i link google maps from within my application without paying fees?

Hi everyone! When i use the Google Maps API from within my commercial application, i have to sign-up for an API key and i have to pay fees for the usage of the Google Maps API. What happens if i just use a link that opens a new browser window in my app? Example: http://maps.google.de/?saddr=Los_Angeles&amp;daddr=hollywood Do i have...

How to create a directory in runtime with full rights to all users, using Delphi?

I need to create a directory inside COMMONAPPDATA (if it doesnt exists) with full rights to every user of that computer (everyone will be able to read or write to that dir). I'm looking for native simple code to do this in Delphi, without using third part libs or components. ...

Correct the value on datetimepicker when user selects a date

Whe a user selects a value in my TDateTimePicker I want to override the to-be-set value to the start of the week that goes with the selected value. I tried setting it in the OnChange event, but then the originally selected value will be set right after I finished the event. How would I go about this? ...

How I use multiple columns on TCheckListBox?

I'm using the TcheckListBox control and would like to use a second column on this, but besides the Columns and Header properties, I could not find any source on inserting the multicolumn contents... It can look like a noobie question, but Delphi's help doesn't have any content on this, and my searches (on Google and SO) brought much gar...

Strip quotes from a string

Hi. How do I strip Quotes from a string using Delphi? Ex. I need to remove all the quotes from 'A','B','C','D', giving a result of A,B,C,D. I've tried MyVar := jclStrings.StrRemoveChars(sRegions, [#34]); but no luck so far. Thanks, Pieter ...

Delphi - Write string to Reg_Binary registry key

I need to convert a string to write it into a registry.reg_binary key. I have the basic code for writing into the key as follows: try rootkey := HKEY_CURRENT_USER; if OpenKey(Key, False) then begin reg.WriteBinaryData('SomeKey', SomeValue, Length(SomeVale)); CloseKey; end; finally reg.Free; end; In the abov...

JPEG-LS / LOCO-I compression library

What implementations are available for the JPEG-LS compression standard? JPEG-LS is the new (relatively speaking) lossless JPEG format based on the HP LOCO-I (LOw COmplexity LOssless COmpression for Images) algorithm. I am aware of the HP reference implementation which appears to no longer come with source code, and the following third-...

Find all Class Helpers in Delphi at runtime using RTTI?

Does the extended RTTI in Delphi 2010 offer a way to list defined Class and Record Helpers at run time? As far as I know Delphi does not show a hint or warning when more than one class helper is defined for a class, class helper detection might be a helpful routine in 'quality assurance'. p.s. of course I know I should never ever use t...