delphi-2009

What is TMonitor in Delphi System unit good for?

After reading the articles "Simmering Unicode, bring DPL to a boil" and "Simmering Unicode, bring DPL to a boil (Part 2)" of "The Oracle at Delphi" (Allen Bauer), Oracle is all I understand :) The article mentions Delphi Parallel Library (DPL), lock free data structures, mutual exclusion locks and condition variables (this Wikipedia art...

What are Delphi 7 and Delphi 2009 differences which deals with characters, strings, unicode and the like?

I had a class that only worked in Delphi 7 and after several attempts of converting it into Delphi 2009 we finally agreed to change our project into Delphi 7. The project more or less done, but I want to give the 2009 thing another shot. Aside from Sizeof(Char) equals 1 in Delphi 7 and 2 in Delphi 2009, what are other changes that I n...

What problems are there using generics and anonymous methods in Delphi 2009?

I'd like to start using generics and anonymous method, mainly to learn what that's all about and why I would want to use them. Having Delphi 2009, I often read that generics and anonymous methods are not completely implemented or buggy, which was fixed in Delphi 2010. I would like to avoid having to wonder if it's my fault or a bug in ...

Initialization in Delphi

When compiling code without initializing a THandle the Delphi 2009 compiler gives a warning of the variable not being initalized. Is there any need to initialize these THandles? If you need to init. them do you need to also free a THandle when you no longer need it? ...

Is System.Pos in Delphi Flawed?

Problem If the text in TRichEdit is something like this; 'hello, world'#$D#$A Then the following routine displays TRUE. However when the RichEdit has 'test'#$D#$A#$D#$A'test'#$D#$A#$D#$A'test'#$D#$A Then the routine displays FALSE. It seems to me to be flawed as it is finding the comma's but not the newlines/linefeeds. I created ...

Delphi - Making a user control a container without inheriting from an existing container

I need to make a control a conainter(that holds other controls at design and run time) similiar a TPanel, without inheriting from the custom panel or a similar control, how do i tell my control that its suppose to contain stuff??? ...

How Do I Properly Call GetLongPathName Using Delphi 2009 and Unicode Strings?

I need to change the old Win98 short path names to long path names. I had a routine that worked fine with Delphi 4, but when I upgraded to Delphi 2009 and Unicode, it didn't work with Unicode strings. I looked around and couldn't find a Unicode-compatible version of it. It appears that the correct routine to use is GetLongPathName from...

Progressbar in splash while copying a file on program load.

OK, here is the complete code for the Splashbar.pas, still have three progressbars, as I want to see what they look like before I choose one. It also includes some stuff that's disabled, as I can't get them to work. unit Splashbar; interface uses ExtActns, Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, ...

Which dbExpress ServerCharSet do I need for utf8 data in MySQL 5?

We tried ServerCharSet=utf8 and ServerCharSet=UTF8, based on information found in newsgroups - but still, special characters / Umlauts do not appear correctly in the client data. We use Delphi 2009 and the built-in dbExpress driver. Field data is retrieved using AsWideString. ...

Having a problem with XML-RPC and Delphi

unit Unit2; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, IdIOHandler, IdIOHandlerSocket, IdIOHandlerStack, IdIntercept, IdCookieManager, IdZLibCompressorBase, IdCompressorZLib, IdSSL, IdSSLOpenSS...

OleContainer - Opening a doc file from http ?

Hello everyone. I need some info about OleContainer. I embedded an OleContainer in the browser. And when I launch that html file,a microsoft word OleContainer is opened and I want to display content of a doc file from the web. For example, when I open html file, OleContainer should view the content of the www.example.com/example.doc whi...

Windows 7 - Displaying "Access denied" message when user tries to save file to a protected folder rather than save in virtual store

Hi, We want to restrict files being saved to the virtual store in Vista/Windows 7 if the user tries to save files from our application to a protected folder such as "Program files" - we want an "Access Denied" message displayed if the user tries to do this. Is there a way to do this from our Delphi 2009 app similarly to what MS Word et...

how to add transparent pixels above and below a 32 bit bitmap images

I need to add at runtime to an inmemory image 15 lines of transparent pixels on top and 20 on the bottom. The images are loaded in a TcxImagelist (from DevExpress Express Library), they can be therefore retrieved as 32bit bitmaps. If the image is 400x75 after the manipulation should be 400x(75+15+20) = 400x110 How to perform this task...

Delphi TIDHttp Get bug

Hi guys, I just discovered a bug in tidhttp component. The scenario is this, im creating a small to fetch the pages of website using tidhttp get. I tried it in ebay all is ok, now after ebay i tried amazon thats where i encountered a problem. What happenned on my side is i searched for item "lenovo laptop" in amazon and copied the url o...

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...

Closing 2 secondery delphi forms with 'caFree' causes the Main Form to lose focus

Showing 2 secondary forms from the main form and then closing both forms will cause the main form to lose focus. (another application gets activated instead of mine) The secondary forms are created either by the Main Form directly or by creating the third form from the second form. The secondary forms set caFree in the OnClose event: ...

How to get the columns' names in a TDbxReader instance

I want to make a report with a TDbxReader instance but don't find the way to get the name of aReader.value[index] column. Somebody could help me? aCmnd.Text := 'SELECT * FROM Country'; aCmnd.Prepare; aReader := aCmnd.ExecuteQuery; aColCount := aReader.ColumnCount; Writeln( 'Results from Query: ' + aCmnd.Text ); // wr...

How can I remotely read binary registry data using Delphi 2010?

I am trying to remotely read a binary (REG_BINARY) registry value, but I get nothing but junk back. Any ideas what is wrong with this code? I'm using Delphi 2010: function GetBinaryRegistryData(ARootKey: HKEY; AKey, AValue, sMachine: string; var sResult: string): boolean; var MyReg: TRegistry; RegDataType: TRegDataType; ...

Delphi error appeared suddenly on one machine: E2056 String literals may have at most 255 elements, how is it possible?

I was able to build one application up to this morning, then I don't know what happened as I try to build I have [DCC Error] myunit.pas(1710): E2056 String literals may have at most 255 element` Why this if this was working? (1710) was not edited in last month. I checked with a colleague project options and environement options one by...

Decompressing gzipped files in Delphi 2009

Up until Delphi 2007 I was using DelphiZlib 0.2.99 for decompressing gzipped files. In Delphi 2009 the library does not compile anymore. Besides the conflict with Delphi's own zlib.pas unit, the code generates a number of string-related compiler errors and warnings which I don't think I can fix without a close understanding of the librar...