delphi-2010

How to start building a searchable garbage collector in Delphi (2009-2010)

浪子不回头ぞ 提交于 2019-12-07 02:26:58
问题 I'm looking for a way to control all business objects I create in my applications written in Delphi. As an article on Embarcadero's EDN (http://edn.embarcadero.com/article/28217) states, there are basically three ways to do this. I'm mostly interested in the last one, using interfaces. That way, when the business object is no longer being referenced anywhere in the application, it will be dispose of memory wise (I'll get back on this part later). When creating a new business object, it would

How can I declare an array property?

て烟熏妆下的殇ゞ 提交于 2019-12-06 20:21:06
问题 I constructed class system TTableSpec=class(Tobject) private FName : string; FDescription : string; FCan_add : Boolean; FCan_edit : Boolean; FCan_delete : Boolean; FFields : array[1..100] of TFieldSpec; public property Name: String read FName; property Description: String read FDescription; property Can_add : Boolean read FCan_add; property Can_edit : Boolean read FCan_edit; property Can_delete : Boolean read FCan_delete; property Fields : array read FFields; end; Thus in TableSpec Fields

D2010 compiled line count discrepancy

二次信任 提交于 2019-12-06 19:47:47
问题 When building a project there are two places where source line count is reported: On the compile progress dialog Under Project | Information In Delphi 2007 these two numbers were identical for the project we are building. In Delphi 2010 these two numbers are wildly different. The (1st) count is larger by a count of 1 million lines or 40%. The (2nd) count is close enough to the Delphi 2007 count to be satisfied the correct files are being built accounting for code changes in porting to D2010.

GExpert's Replace Components Expert doesn't replace the text in the form file (*.dfm)

北城余情 提交于 2019-12-06 13:19:44
I am using Delphi 2010 and GExperts stable release 1.35 I am testing the "Replace Components" expert. I add a main form and a secondary form. Each has three TEdits on it. I use the Replace Components Expert to replace all TEdits with TRzEdit. I Check the Replace all components on all forms of the project. It works, it replaces them all. However, it doesn't do anything to the DFM file. How do i make it replace those instances. If i save, compile, or rebuild, i get errors. If i try to view the form as text after replacing, i get errors. Can someone explain to me the steps to make this work?

convert function to delphi 2009/2010 (unicode)

喜你入骨 提交于 2019-12-06 12:25:15
问题 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; L : Word; TestChar: string[1]; begin Ans := ''; L := Length(InStr); if L > 0 then begin for I := 1 to L do begin TestChar := Copy(InStr, I, 1); if TestChar <> ' ' then Ans :=

How to mix Mp3 files

非 Y 不嫁゛ 提交于 2019-12-06 08:46:38
问题 I would like to mix MP3 files with Delphi 2010. Is this possible? Does anyone know of a component (set) I could use to get this done? Or maybe a runtime library? Any tips from someone with experience mixing MP3 files? 回答1: I use newAc: http://symmetrica.net/newac/ it has a soundmixer component and supports mp3 inputs. Cheers! 回答2: FFmpeg has pascal headers, which apparently you can use from delphi: http://www.iversenit.dk/dev/ffmpeg-headers/ This should allow you to load mp3s or any other

Improve speed on Crc16 calculation

我的未来我决定 提交于 2019-12-06 07:49:24
I need to calculate Crc16 checksums with a $1021 polynom over large files, below is my current implementation but it's rather slow on large files (eg a 90 MB file takes about 9 seconds). So my question is how to improve my current implementation (to make it faster), I have googled and looked at some samples implementing a table lookup but my problem is that I don't understand how to modify them to include the polynom (probably my math is failing). { based on http://miscel.dk/MiscEl/CRCcalculations.html } function Crc16(const Buffer: PByte; const BufSize: Int64; const Polynom: WORD=$1021; const

What version of Delphi will let me create software that runs on a Mac?

泄露秘密 提交于 2019-12-06 05:48:40
I use Delphi and last year I upgraded from D5 Enterprise to Delphi 2010 Profession. Occasionally I get emails asking when I will have a version that runs on a Mac. Is there a version of Delphi out there that will create software that runs on a Mac? If not, do you know if Embarcadero plans on rolling out a version that does this in the near future? See the roadmap: http://edn.embarcadero.com/article/39934 Project "Pulsar", slide 13. In the short term, many Delphi apps run just fine on the Mac in emulation, such as Parallels Workstation. Have you tried the Lazarus IDE which is usign Free Pascal

How do I programatically add actions to an Action Manager in Delphi 2010

霸气de小男生 提交于 2019-12-06 05:42:47
I am trying to dynamically add actionitems, I can add the item and it works when I do this: HostActionItem := ActionManager.ActionBars[0].Items[0].Items[2]; NewItem := HostAction.Items.Add; NewItem.Action := MyActionToPerform; NewItem.Caption := Description; NewItem.ImageIndex := 1; NewItem.Tag := 13; However, when the action Execute method fires I attempt to get the ActionComponent from the Sender object like this: if (Sender is TAction) then tag := (Sender As TAction).ActionComponent.Tag; But the ActionComponent is always nil. Why is the ActionComponent not being initialised? Sertac Akyuz

Global, thread safe, cookies manager with Indy

时间秒杀一切 提交于 2019-12-06 05:35:53
My Delphi 2010 app uploads stuff using multi-threading, uploaded data is POSTed to a PHP/web application which requires login, so I need to use a shared/global cookies manager (I'm using Indy10 Revision 4743 ) since TIdCookieManager is not thread-safe :( Also, server side, session id is automatically re-generated every 5 minutes, so I must keep both the global & local cookie managers in sync. My code looks like this: TUploadThread = class(TThread) // ... var GlobalCookieManager : TIdCookieManager; procedure TUploadThread.Upload(FileName : String); var IdHTTP : TIdHTTP; TheSSL :