delphi-2010

How to set event handlers via new RTTI? [D2010]

Hi all, Playing with new RTTI module, I couldn't find a way to set an event handler with the new utilities. Trying something like this: LProp := TRttiContext.Create.GetType(Form1.ClassInfo).AsInstance.GetProperty('OnClick'); LProp.SetValue(Form1, {a TValue!}); SetValue needs a TValue passed but I've yet to find a way to represent a T...

How does one access the 'NameThreadForDebugging' in Delphi 2010

Hi How do I access the 'NameThreadForDebugging' in a delphi Thread in Delphi 2010 ? type TMyThread = class(TThread) protected procedure Execute; override; procedure UpdateCaption; end; implementation procedure TMyThread.UpdateCaption; begin Form1.Caption := 'Name Thread For Debugging'; // how I get 'TestThread1' d...

Database Component for Firebird using D2010

I just upgraded my BDS2006 Prof to D2010 Prof. I usually use Interbase component (TIBDatabase, etc) to connect with the database. I am thinking about other alternative components. Sadly, Zeos component (6.X) currently still not working with D2009/D2010. DBExpress support FB connection but not in Prof. Version (only in Enterprise/Architec...

Move project from Delphi 3 to Delphi 2010

I've been asked to re-open a project I wrote in 1998/99 in Delphi 3 and which has been running stably since then. I have the Delphi 3 code base on an aging Windows 98 machine which exists only to keep this project alive. Obviously, I'd like to bring the source code base into the 21st century before undertaking any major revisions. I n...

How to install TWebBrowser in Delphi 2010

Is there any way of installing TWebBrowser in Delphi 2010 directly without having to install the Web Development Controls? If I select the Web Development Controls option on the Delphi 2010 setup, TWebBrowser is installed. But this "package" is over 200 MB and I only need TWebBrowser. Any way of installing TWebBrowser directly on Delph...

Which features of Delphi 2010 Enterprise version are valuable to you, and why?

I'll shortly be making a purchase decision regarding Delphi 2010. I've always been a "Professional" level developer (meaning I've owned the "Professional" SKU of the product before), but I'm considering buying the Enterprise edition this time. I pay for my own tools, and the $1150 difference in price (for the RAD studio product) is no...

convert function to delphi 2009/2010 (unicode)

I'm slowly converting my existing code into Delphi 2010 and read several of the articles on Embarcaedro web site as well as Marco Cantú whitepaper. There are still some things I haven't understood, so here are two functions to exemplify my question: function RemoveSpace(InStr: string): string; var Ans : string; I : Word; ...

delphi 2010 IDE 'error insight' error

Hello when I open concrete projects the error insight mark with red lines incorrect areas of the screen. Also when I compile It, error messages are shown, but the line number displayed in the message window points to a wrong line in the code window. When I double click over a error message the ide goes to another line. how do i correct ...

Delphi 2010, DeHL, file not found

Hi, Have installed trial version of Delphi 2010, and hoped to get a look at DeHL. There must be something that I have missed out on, though, cause I can't find out how to include any of the units without getting a 'file not found'-error at compile time... What I have done, is to include the path to the pas-files in the projects 'Incl...

Does it make more sense to upgrade to Delphi 2009/2010 or to buy Software Assurance?

If you've purchased the Software Assurance, can you please share your experience? Was it worthwhile? I vaguely remember reading some negative comments about SA maybe 1 or 2 years ago. ...

Any build-in Delphi function like PosEx that finds a sub-string starting from the back of the string?

Is there any Delphi D2010 function like PosEx that finds a sub-string inside a string starting from the end of the string? I'm removing all the calls to the FastStrings library and one of the functions I was using was FastPosBack: function FastPosBack(const aSourceString, aFindString : AnsiString; const aSourceLen, aFindLen, StartPos :...

case insensitive Pos

Is there any comparable function like Pos that is not case-sensitive in D2010 (unicode)? I know I can use Pos(AnsiUpperCase(FindString), AnsiUpperCase(SourceString)) but that adds a lot of processing time by converting the strings to uppercase every time the function is called. For example, on a 1000000 loop, Pos takes 78ms while conve...

How to 'insert' a new page inside a TPageControl

Best way to 'insert' a page in a TPageControl if i already have many pages full of controls? Let's say i want to insert a new page before TabSheet1. Thanks. UPDATE : At design time. ...

How to get access field in Delphi using RTTI?

Hi all, and sorry for my English. Consider the following: TFieldType = class fValue: string; end; TMainClass = class private Ffield: TFieldType; public function GetValue: string; end; In TMainClass.GetValue I'm tryin get values of TMainClass fields: function TMainClass.GetValue; begin vCtx := TRTTIContext.Create; vType := ...

How can I make a form transparent according to a PNG image?

So, I have a png file that uses transparency(is actually a circle with gradient effect from black, in the middle, to transparent on the margins). I am putting this on a form using TImage. I am setting TForm1.Color and the TForm1.TransparentColorValue to the same value and TForm1.TransparentColor:=true. Now, when I run the program the gr...

Delphi's TFrames not keeping their size when reloading a project?

I have a project with a lot of frames, and when I reload my project, they are resized to a width and height of 443x270, or thereabout. I do reside the frames at runtime, but I wish they would remain as I create them at design time. I use the non-embedded, classic undocked view. Anyone has any idea on how to have the frames keep their s...

Copying lots of files in Delphi

Hi In my application I need to copy over 1000 small files Here is the code I am using but it is VERY SLOW Is there a better way of doing this ? procedure Tdatafeeds.RestotreTodaysFiles; var SearchRec: TSearchRec; FromFn, ToFn: string; Begin if DirectoryExists(BackupPath1) then begin try if FindFirst(BackupPa...

Files needed to deploy delphi 2010 dbxpress application

I'm having trouble deploying my delphi application. It uses dbxpress to access mysql 5.1 database. When i run the application from another computer, an error occurs. I've already included the midaslib.dll in my application and copied the dbxmys.dll and libmysql.dll in the same folder as my application. Hope someone can help. ...

Delphi 2010: New RTTI, setting propertyvalue to arbitary value

TRTTIProperty.SetValue( ) takes an TValue instance, but if the provided TValue instance is based on a different type then the property, things blow up. E.g. TMyObject = class published property StringValue: string read FStringValue write FStringValue; end; procedure SetProperty(obj: TMyObject); var context: TRTTIContext; rtti: T...

Adding Delphi 6 third party component to Delphi 2010?

Hi, I have a few Delphi 6 third party components which I need to add to Delphi 2010 to begin my migration. Is it possible? The interface seem a lot different and I can't seem to find a way to do this? This help... My components: DBGridEasy, TSerial, Varian Async32. Thanks a lot. ...