delphi

Improving Delphi 2009 IDE speed on a huge project using many components and libraries

I am using Delphi 2009. On a huge project 300+ units, 5 third party components, many libraries, very often the IDE gets frozen for seconds, very often when "intellisense" (I don't remember how it is called) tries to give me suggestions. Is there a way to improve the performance? I will try also the following improvements: 1) format m...

How do I return exceptions from a Web service?

I've written a simple web servrice application in Delphi using THTTPSoapDispatcher and THTTPSoapPascalInvoker. Everything works ok, except that I don't understand how to handle exceptions. So whenever an exception occurs inside the service method, the following SOAP response is generated: <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:S...

Printer Print Size

How can i set the printing size (width and height) by code without showing a dialog? Thanks ...

Keep supporting different versions of software each one built with different Delphi or component versions

i need to maintain different versions of a software, the problem is like this: 1) v 1.0 - Delphi 7 - DevExpress build 20 - TeeChart 5 2) v 2.0 - Delphi 2005 - DevExpress build 40 - TeeChart 7 3) v 2.1 - Delphi 2009 - DevExpress build 52 - TeeChart 8 4) v 3.0 - Delphi 2009 - DevExèress build 53 - TeeChart 2010 (of course this is an e...

Resizing buttons so they are all the same width.

I have a "wide" TPanel with several buttons on it (essentially a tool bar). All the buttons have Align=Left. I have created a function which will resize the buttons to the same size and calculate the width of them so they fill the entire TPanel. I call this function in the OnResize event handler of the TPanel. procedure ScaleButton...

Named threads in Delphi - what is that for?

Hello. When you create a TThread descendant using the tool palette in your BDS, you can provide a name for the thread. Here's the auto-generated code. You just call the SetName() function in the Execute method and the thread calling this method is given a name in a kind of weird way... {$IFDEF MSWINDOWS} type TThreadNameInfo = record...

Insert Unicode chars to MySQL with Delphi 2010

Trying to insert values with Unicode Chars into a MySQL-database using Delphi 2010 and TADOConnection with no luck. Connection with ODBC Provider=MSDASQL.1;Persist Security Info=False;Data Source=mysrc;Initial Catalog=mydb The SQL command: INSERT INTO myTable (aCol) VALUES('Russian: русский язык') Tried inserting it directly with...

How can I merge two Delphi projects?

Is there a way to merge two Delphi projects into one? In one project I have 3 different forms with different stuff on them, but I would like to add a program I have coded a while ago into a new form in my program. ...

Loading Picture into image Delphi

Hello I am currently working on a program and I would like to add a button that would allow the user to Load a picture from his computer into the Image procedure TForm1.btnLoadPicClick(Sender: TObject); begin img1.Picture.LoadFromFile( 'test.1'); img1.Stretch := True ; I was using this code but it limits the person to only being ab...

Delphi threading - which parts of code need to be protected/synchronized?

Hi, so far I thought that any operation done on "shared" object (common for multiple threads) must be protected with "synchronize", no matter what. Apparently, I was wrong - in the code I'm studying recently there are plenty of classes (thread-safe ones, as the Author claims) and only one of them uses Critical Section for almost every me...

Application compiled with Delphi 2010 (Windows XP3 machine) don't run on Windows 7 - error at kernelbase.dll

Application compiled with Delphi 2010 (Windows XP3 machine) don't run on Windows 7. However, it runs fine on Windows XP. I see no special message when the program is compiled with D2010. Third party component used are AnyDAC and wwDBGrid (woo2wool). Here the event message produced when executed on W7 (the program just don't start, win...

How to determine if all characters in a string are equal.

I need to know if all characters in a string are equal (formed by the same character). the function must return true or false depending if all the elements of the string are equal to an particular char. I wrote this function that works well, but I'm looking for a more optimal (fastest) solution, the strings can have thousands of chars...

Debug COM port read/write using software/virtual COM port and console/terminal on the other end

I have a Delphi application that reads/writes to a COM port connected to a large hardware device, so I don't usually have the hardware available during development. That said, the communication protocol is fairly simple, so I can generally do the development and have someone onsite test it, and it usually works. Occasionally I run into...

Is there a Template Engine like Velocity or Freemarker for Delphi?

Is there a template engine for scripted code generation like Apache Velocity or Freemarker (see examples below) which I can use in Delphi applications? (not in the IDE - I am not lookig for a OTA based solution, or Delphi code templates) The template engine would bind Delphi objects to a template and replace the script variables, and ex...

XML Data Binding Wizard doesn't bind XSD's correctly.

Simple issue, actually. Just curious if others recognize the problem and perhaps have a working solution for it... I have a simple XSD file which I use to define a configuration file that is used by my application. I need to bind this schema to my project and this is done using the XDBW. In Delphi 2007, this wizard would just recognise ...

delphi 7 - create a custom warning

hi, I'm using Delphi 7, and I want to create a custom warning message(which will be showed at compilation), so I can warn other programmers on some modifications. I've searched on the internet but i didn't found anything relevant. Other solutions, are welcomed as well, as long other programmers are warned about things I want, when the...

ADOQuery closes after contructor

in Delphi 7 , useing TADOQuery. in the contructor i do ADOQuery.open; then when another function is called from outside the form, the ADOQuery is closed why? constructor TClass1.Create(AOwner: TComponent; MyParam: TProgramParam); begin inherited; ADOQuery.Open; ADOQuery.Locate('fieldName',Param); end; ...

Delphi AES library (Rijndael) tested with KAT Vectors

Hi, for these 2 libraries, Delphi Encryption Compendium v 5.2 TurboPower Lockbox v 2.07 I tested their Rijndael DCB/CBC algorithm with "AES Known Answer Test (KAT) Vectors" obtained at NIST website (http://csrc.nist.gov/groups/STM/cavp/index.html) But, both of these libraries failed the tests. Not sure if it was my testing that has...

Problems with IPC SendMessage

Hi I'm having problems with my SendMessage. It seams like the message never reaches my form (I'm using Winspector Spy to see which messages that are registered in my form), which is strange because I'm shure I'm sending to the correct Handle for the current form. The SendMessage is within a dll but that should not have any thing to ...

Delphi: How to hide ancestor constructors?

Update: gutted the question with a simpler example, that isn't answered by the originally accepted answer Given the following class, and its ancestor: TComputer = class(TObject) public constructor Create(Teapot: string=''); end; TCellPhone = class(TComputer) public constructor Create(Cup: Integer); overload; virtual; co...