delphi

Switching from debug to release configuration having no effect on performance?

i have tested a couple of benchmarking snippets on delphi like this one: uses ...diagnostics; procedure TForm2.Button1Click(Sender: TObject); var i,elapsed : integer; stopwatch : TStopwatch; ff: textfile; begin if FileExists('c:\bench.txt') then DeleteFile('c:\bench.txt'); stopwatch := tstopwatch.create; s...

Delphi 7 - best way to save & restore a form

So, I have a form with a few dozen controls and someone would like to save & later restore their contents & settings - which radio button was selected, what was the Position of that up/down, etc What's the simplest way to do it? DfmToString & reverse? Write/read a .INI ? Something else? ...

Get the offset of a field in a delphi record at runtime

Given a record type: TItem = record UPC : string[20]; Price : Currency; Cost : Currency; ... end; And the name of a field as a string, how can I get the offset of that field within the record? I need to do this at runtime - the name of the field to access is decided at runtime. Example: var pc : Integer; fieldName...

How to use TShiftState type variable?

I am developing a Delphi application. On TImage.MouseDown event I want to do X task if shift key is pressed, Y task if control key is pressed and Z task if any of them is not pressed. For that I am using TShiftState variable. Now I have a function in which I have to pass this variable as parameter. procedure Something(keyState : TShif...

Covnerting PDF's to TBitmap image

what is the easiest method to convert a PDF into a TBitmap image in delphi? if there are any commercial available tools for delphi, I can buy one if it is reliable and or not expensive... I am thinking of some kind of viewer which I can browse pages.. zoom... and export in the desired resolution.. ...

Delphi: How to create a Windows autostart application like Skype does?

I'd like to add an option to my application similar to the Skype's option "run Skype as my computer starts". Skype doesnt't go on the "Auto start applications" of the start menu folder, I'd like to have the same effect. Note, one answer to this question suggets to add a key here: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVe...

How can I store a COM object in Inno Setup's TNewComboBox.Objects property?

I'm using Inno Setup to create an installer for my application. I'm currently filling a combobox (TNewComboBox) with the names of the Web sites on the current machine's IIS install. Now what I really want to do is store the COM object alongside the string in the objects property of the combo but keep getting type mismatch errors, even ...

Delphi - TClientDataSet: Second call to applyupdates() does not apply the updates

Again I have a problem with the TClientDataSet. I guess it's something really simple but I struggle on it for a while now. Here's some code what shows what I want to do: procedure TForm1.Button1Click(Sender: TObject); begin ClientDataSet1.Insert; ClientDataSet1.FieldByName('anruf_von').AsDateTime := time; ClientDataSet1.Post; C...

how can i manage connections in Indy ? (Delphi)

Hi , i am writing a simple client/server chat program with indy 10 (blocking mode) and there is a question that how can i manage connections ? for example imagine a user that is online on server , we must make a connection tunnel for future requests . In other words, when a user is online server should not need username and password for ...

Removing fills in SWF files

Hi, guys! I believe I have a different problem. We have some dozens of SWF files and we need remove a certain fill of each SWF file, to each frame! That fill is purple color and it should help, but we aren't SWF experts. What we want is developing a tool (in Delphi, C++ or any language) able to read each SWF file and modify it, generat...

Error in installing JEDI.

I downloaded JEDIVCL package.... according to its help i have to run install.bat from jcl folder and then run install.bat from jvcl folder. i launched install.bat from jvcl folder but i received this error: and if run install.bat from jcl folder receive this error: How can I solve this problem? if its possible give me steps to ins...

postgresql equivalent of SQL Server sysprocesses loginname and program_name

I am migrating to Postgresql, but I am facing a problem. A "trick" I am using with SQL Server is to login always using a single user (tipically sa) and I write the program_name in the database connection to check the number of currently logged users in the application. Everytime I do a db connection for UserX I set the program_name in t...

TNTUnicode components problem

I downloaded and tried installed the TNT Delphi Unicode components. I use Code Gear Delphi 2007. Then I opened the TntUnicodeVcl_D70.dpk and tried to build it. The following message appeared **The following changes must be made before this package can be compiled. Choose OK to apply these changes and continue compiling Remove TntAc...

IDAPI , BdeAdmin and Windows 7

After many months of postponing it, this week, I finally started using a new Windows 7 Professional PC for actual development (which is 90% still done in Delphi 7 with some of these programs still using the Borland IDAPI to access Paradox files). The previous development pc was still an XP-one. Every thing works except for one thing: so...

how to sort in Tlistview based on subitem[x]

hey all how to sort in tlistview with data present in subitem[x] regards ...

My delphi application is incompatible with native keyboards. What should I do?

My delphi application is incompatible with native keyboards. What should I do? To explain more, first look at these pictures: Here's an image of what an Italian keyboard looks like: http://en.wikipedia.org/wiki/Keyboard_layout#Italian You can find the normal one (United States keyboard) in the same page. If we press the Shift+2 (or an...

Delphi with HTML/CSS interface

I want to develop a delphi application with an HTML/CSS graphical user interface, not necessarily running from within a web browser. I want to do this do create a richer graphical user interface with animations etc. and break away from normal VCL components / Windows look. Any suggestions? ...

How to detect when the mouse move away from a TPanel in Delphi 6?

Hi everyone, I am using the OnMouseMove event to detect when the mouse pointer is over my TPanel, is there a way to know when the mouse pointer had moved away from it? I need the panel to change colour when the mouse pointer is over it and return to its original colour once it moved away from it? I am using Delphi 6 by the way. Pleas...

try/except doesn't seem to capture exceptions - Delphi Service Application

Hi all, I have a service written in Delphi 2007 in which I'm trying capture any unknown exceptions. Assigning a method to the on exception doesn't seem to work ('Forms.Application.OnException:=UnknownApplicationException'). The 'UnknownApplicationException' doesn't appear to get called - I attribute this to the fact that there is no form...

Better way to implement filtered enumerator on TList<TMyObject>

Using Delphi 2010, let's say I've got a class declared like this: TMyList = TList<TMyObject> For this list Delphi kindly provides us with an enumerator, so we can write this: var L:TMyList; E:TMyObject; begin for E in L do ; end; The trouble is, I'd like to write this: var L:TMyList; E:TMyObject; begin for E in L.GetEn...