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...
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.
...
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...
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...
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
...
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?
...
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 ...
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...
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.
...
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...
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?
...
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...
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...
I am using StringReplace to replace > and < by the char itself in a generated XML like this:
StringReplace(xml.Text,'>','>',[rfReplaceAll]) ;
StringReplace(xml.Text,'<','<',[rfReplaceAll]) ;
The thing is it takes way tooo long to replace every occurence of >.
Do you purpose any better idea to make it faster?
...
Is there any conflict?
...
<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...
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);
...
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 ...
I want to get a files these attributes as integer values.
...
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...