delphi

Are delphi variables initialized with a value by default?

I'm new to Delphi, and I've been running some tests to see what object variables and stack variables are initialized to by default: TInstanceVariables = class fBoolean: boolean; // always starts off as false fInteger: integer; // always starts off as zero fObject: TObject; // always starts off as nil end; This is the behaviour I...

Minimize a external application with Delphi

Is there a way to Minimize an external application that I don't have control over from with-in my Delphi application? for example notepad.exe, except the application I want to minimize will only ever have one instance. ...

Password encryption in Delphi

I need to store database passwords in a config file. For obvious reasons, I want to encrypt them (preferably with AES). Does anyone know a Delphi implementation that is easy to introduce into an existing project with > 10,000 lines of historically grown (URGH!) source code? Clarification: Easy means adding the unit to the project, addin...

Problem with adding graphics to TLabel

I'm trying to create with Delphi a component inherited from TLabel, with some custom graphics added to it on TLabel.Paint. I want the graphics to be on left side of text, so I overrode GetClientRect: function TMyComponent.GetClientRect: TRect; begin result := inherited GetClientRect; result.Left := 20; end; This solution has major...

Delphi: OpenFileDialog crashes with URL

Giving a URL to the TOpenFileDialog, the Execute method throws an exception: OpenDialog1.Filename := 'http://www.osfi-bsif.gc.ca/app/DocRepository/1/eng/issues/terrorism/indstld_e.xls'; bResult := OpenDialog1.Execute; But you are allowed to open files from a URL. Delphi 5 ...

Delphi Popup Menu Checks

I am using a popup menu in Delphi. I want to use it in a "radio group" fashion where if the user selects an item it is checked and the other items are not checked. I tried using the AutoCheck property, but this allows multiple items to be checked. Is there a way to set the popup menu so that only one item can be checked? ...

Launching a registered mime helper application

I used to be able to launch a locally installed helper application by registering a given mime-type in the Windows registry. This enabled me to allow users to be able to click once on a link to the current install of our internal browser application. This worked fine in Internet Explorer 5 (most of the time) and Firefox but now does not ...

Why is my stored procedure receiving a null parameter?

Ok, this is a curly one. I'm working on some Delphi code that I didn't write, and I'm encountering a very strange problem. One of my stored procedures' parameters is coming through as null, even though it's definitely being sent 1. The Delphi code uses a TADOQuery to execute the stored procedure (anonymized): ADOQuery1.SQL.Text := "ex...

Delphi Pop Up menu visibilty

Is there a way in Delphi 7 to find out if a pop-up menu is visible (shown on the screen) or not, since it lacks a Visible property. ...

Delphi 2009 and Informix dbExpress problem with Windows 2003

I have simple application that uses dbExpress to connect Informix database. If I compile it with TurboDelphi it works on both WinXP and Win2003. When I use new Deplhi 2009 my app works ok on WinXP but do not start on Win2003. No MessageBox with error, only info in EventLog: Faulting application inf_dbexpress_test.exe, version 0.0.0.0, fa...

Is there an implementation for Delphi:TClientDataSet in C++ for MVS?

I want to migrate from Embarcadero Delphi to Visual Studio, but without a TClientDataset class it is very difficult. This class represents an in-memory dataset. I can't find any class like TClientDataset. Can anyone help me find something like this please? ...

Is there a performance difference between inc(i) and i := i + 1 in Delphi?

I have a procedure with a lot of i := i +1; in it and I think inc(i); looks a lot better. Is there a performance difference or does the function call just get inlined by the compiler? I know this probably doesn't matter at all to my app, I'm just curious. EDIT: I did some gauging of the performance and found the difference to...

Delphi Free and Open Source Components that are still maintained.

It would be good to compile a new inventory here of Delphi FOSS components that are very useful, also with rare and difficult to find functionality and still maintained for the latest Delphi versions. Examples of rare components are for instance "TWAIN" scanning components, raw printing etc. Your comments added will make for a very valua...

StringReplace alternatives to improve performance.

I am using StringReplace to replace &gt and &lt by the char itself in a generated XML like this: StringReplace(xml.Text,'&gt;','>',[rfReplaceAll]) ; StringReplace(xml.Text,'&lt;','<',[rfReplaceAll]) ; The thing is it takes way tooo long to replace every occurence of &gt. Do you purpose any better idea to make it faster? ...

Can Delphi 2009 be installed on the same machine as Delphi 2006 or Delphi 2007?

Is there any conflict? ...

What's a good API for recording/capturing and playing back sound in Delphi and/or C#?

<flavor> I want to create a spelling test program for my grade schoolers that would let them enter and record their spelling words then test them on them through out the week.</flavor> What's a good Delphi API with which I could select a recording device, capture and save sound files, then play them back? I'm also toying with doing the...

Checking File is Open in Delphi

Is there a way to check if a file has been opened by ReWrite in Delphi? Code would go something like this: AssignFile(textfile, 'somefile.txt'); if not textFile.IsOpen then Rewrite(textFile); ...

Delphi OTA and RTTI bug

I'm writing a Delphi expert. I need to be able to write a value to a property on a property which is an object. E.g. I have a GroupBox on the form and I want to edit the Margins.Left property. I'm using the following procedure to do it but if gives an AV on the marked line. The procedure takes a component from the (property editor) the ...

How to get create/last modified dates of a file in Delphi?

I want to get a files these attributes as integer values. ...

Why does regasm.exe register my c# assembly with the wrong GUID?

I've got a c# assembly which I'm invoking via COM from a Delphi (win32 native) application. This works on all the machines I've tested it on, except one. The problem is that the Delphi application gets "Class not registered" when trying to create the COM object. Now, when I look in the registry under HKEY_CLASSES_ROOT\DelphiToCSharp\C...