delphi-2009

How does one create Microsoft Management console(MMC) snap-in in Delphi 2009 ?

Are there an wizard or templates in delphi 2009 to write a MMC console ? EDIT: Colin Wilson components look great thanks. ...

Class Types and Constructor Calls

If I write type MyClass = class of TMyClass; ... Obj := MyClass.Create; the correct constructor (the one in TMyClass) is called. If I write var ClassVar : TClass; ... ClassVar := TMyClass; Obj := ClassVar.Create; only the TObject constructor is called. Why? What's the difference between the two versions? Can I force the TMyCl...

Preventing the IDE from changing a package's "requires" clause

I have a shared runtime package that I am using to support an application that uses packages as a plugin system. I have included several third party units in the shared package to reduce the number of BPLs that have to be distributed. Delphi seems to have some headaches with this set up, occasionally updating only the DCP file in the "...

Delphi 2009: How to communicate between Windows service & desktop application under Vista?

How can a desktop application communicate with a Windows service under Vista/Windows2008/Windows7? The application needs to send small strings to the service and receive string responses back. Both are written in Delphi 2009. (Please provide sample code also) ...

Displaying a negative time in Delphi

Hi, I am developing a timer in Delphi 2009. I am currently using the following to format my timer display: Caption := Format('%.2d', [Hours]) + ':' + Format('%.2d', [Minutes]) + ':' + Format('%.2d', [Seconds]); and this as expected displays the time as: 00:04:35 However, when I go into negative time it is u...

How to disable/hide icon from a form?

How do I create a second form with a close button,but without an icon. ...

Is there a way to edit default build settings?

Every time I create a new project in Delphi 2009, it loads up two sets of build settings: Debug and Release. Problem is, the Debug settings are all wrong. It has optimizations on, which makes the debugger lose local variables, and Debug DCUs off, which keeps me from tracing into the VCL. Is there any way to edit the original template ...

How to build a resource library from rc files in Delphi 2009?

I need to build a resource DLL from a supplied rc file. Here's what I did upto Delphi 2007: library ResourceTest; {$R '..\..\src\Media\TestBitmaps.res' '..\..\src\Media\TestBitmaps.rc'} {$R *.res} begin end. Compiling this project would create the res file from the rc file and link it in the final DLL. In Delphi 2009 it doesn't wor...

How to tile a Image in TImage?

Hello, How do I tile a image in a Timage in Delphi? Why I need it: Instead of creating more TImages at runtime,I could create one and store my image there knowing that it will be 'fit' until it reaches TImage's height and width. Please suggest any ideas to do this. Thank you! EDIT: Please note,I'm not asking for streching the image,...

Delphi and i18n

Does Delphi support internationalization in any way? I've seen that I can add different languages for a project, but that seems to create multiple instances of the dfm files. Am I right that the language therefore cannot be changed at runtime? How do you handle internationalization (if you do)? Are there any best-practices? ...

Showing cell content on hint in DevExpress grid

I am using TcxGridDBTableView from DevExpress. Some of the cells contain really long strings, so I want to be able to show them to users using Hints. I want also to be able to do have line brakes in hint in places of semicolon in my text. Do you know how to simply achieve this? ...

The fastest way to compare a partial string?

Hello, I have to compare a partial string "SKILL_______EU_______WAND_______CLERIC_______BASE_____01" with "SKILL".It's meant to check if the first four characters are "SKILL".or the first character only,optimization is needed here! My problems: I don't know how to do an optimized comparison. It has to be repeated 35 000 times so it ...

Best Delphi Regex library

Hello, I am searching a pure Delphi library with good full-Perl syntax support. It should: match groups (both named and numbered) be able to match, replace, split support look-ahead and look behind come with source be free support Unicode be compatible with Delphi 2009 Which library you prefer? ...

What is the most common way to create a folder selection dialog using Delphi?

There doesn't appear to be a simple component available to create a folder selection dialog in Delphi 2009, although a file selection dialog is provided by way of the TOpenDialog. What is the most common way to create a modern folder selection dialog using Delphi? ...

TListView.Clear freezes my application,how do i fix it?

Hello, I have a ListView:TListview on my form ,and, I add many values(approximately 25k TListViewItem) ,which works quite fast,but when I call Listview.Clear,the program freezes.I checked it with debugger,it won't step that line. My question is,how do I solve my problem? If creating so many items in less than a second is possible,why d...

How to change a subitem in a listview?

Hello, I used Listview.items.item[X].caption for changing the first column in a listbox,but now I have to change further at runtime.The only way I see is getting the item from listbox as TListItem ,editing it,add it and change position,but that doesn't suit it,because I have many items on the listview. Is there a simpler way to accompl...

Why doesn't my form's OnKeyDown event handler fire?

I'm using Delphi 2009 and I followed a tutorial at delphi.about.com, but I couldn't set it. I created an event OnKeyPress/OnkeyDown and set a breakpoint to see if the event is called, but it's not being called in any way. Where is the problem? EDIT: procedure TFormMain.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState)...

Is there a way to change the default generated code wrapping width in the Delphi IDE Editor?

Now that I have a widescreen monitor, I can't seem to find a way to make the Delphi IDE wrap generated code at anything other than 80 chars. I've set the "Right margin" setting in the IDE Editor options to a high value, but it doesn't appear to affect the wrapping that happens on generated events and code lines. Does anyone know of a w...

TComboBoxEx Items wont indent when populated at runtime

Edit: Update at bottom. Hope someone can help here as it's driving me round the bend! Delphi 2009 I have a form with two TComboxBoxEx components on it One I populate at runtime with the following code procedure TForm1.btn1Click(Sender: TObject); var N: Integer; begin cb1.ItemsEx.Add.Caption := 'Test'; for N := 0 to 5 do w...

What is wrong with this "StretchKey" implementation?

I'm trying to create a Delphi version of this algorithm: void PWSfileV3::StretchKey(const unsigned char *salt, unsigned long saltLen, const StringX &passkey, unsigned int N, unsigned char *Ptag) { /* * P' is the "stretched key" of the user's passphrase and the SALT, as defined ...