delphi-2009

“ERROR MSB4040 There is no target in the project” when using msbuild+Delphi2009

孤街浪徒 提交于 2019-11-30 01:18:02
问题 I'm trying to automate the build of a project in Delphi 2009. I'm using msbuild with .net 3.5 I simply call: Z:\Server>C:\WINDOWS\Microsoft.NET\Framework\v3.5\msbuild "BestSellerAppServer.g roupproj" /target:Build And get this: Build started 27/08/2009 01:15:45 p.m.. Project "Z:\Server\BestSellerAppServer.groupproj" on node 0 (Build target(s)). Project "Z:\Server\BestSellerAppServer.groupproj" (1) is building "Z:\Server\Be stSellerAppServer.dproj" (2) on node 0 (default targets). Z:\Server

Delphi 2009, Indy 10, TIdTCPServer.OnExecute, how to grab all the bytes in the InputBuffer

旧时模样 提交于 2019-11-30 01:00:40
I am messing around with the Indy 10 supplied with Delphi 2009 and am having trouble with getting all the data from the IOHandler when OnExecute fires... procedure TFormMain.IdTCPServerExecute(AContext: TIdContext); var RxBufStr: UTF8String; RxBufSize: Integer; begin if AContext.Connection.IOHandler.Readable then begin RxBufSize := AContext.Connection.IOHandler.InputBuffer.Size; if RxBufSize > 0 then begin SetLength(RxBufStr, RxBufSize); AContext.Connection.IOHandler.ReadBytes(TBytes(RxBufStr), RxBufSize, False); end; end; end; AContext.Connection.IOHandler.InputBuffer.Size doesn't seem

How to increase the startup speed of the delphi app?

纵饮孤独 提交于 2019-11-29 23:14:01
What do you do to increase startup speed (or to decrease startup time) of your Delphi app? Other than application specific, is there a standard trick that always works? Note: I'm not talking about fast algorithms or the likes. Only the performance increase at startup, in terms of speed. Try doing as little as possible in your main form's OnCreate event . Rather move some initialization to a different method and do it once the form is shown to the user. An indicator that the app is busy with a busy mouse cursor goes a long way. Experiments done shows that if you take the exact same application

What is TMonitor in Delphi System unit good for?

自闭症网瘾萝莉.ら 提交于 2019-11-29 22:13:12
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 article forwards to ' Monitor (synchronization) ', and then introduces the new TMonitor record type for thread synchronization and describes some of its methods. Are there introduction articles with examples which show when and how this Delphi record type can be

ADODataSet deleting from joined table

我怕爱的太早我们不能终老 提交于 2019-11-29 21:43:41
问题 I have a Delphi app where I display a list of games that have been played from a query like this: select g.*, gt.id, gt.descr from GAMES g inner join game_types gt on gt.id = g.game_type order by game_date DESC When I click the delete button in the DBNavigator, the joined record from the game_types table is also deleted. That's a problem because many other games can be of the same type. What do I need to do to make it so that only the game is deleted but not the game type? 回答1: You need to

How can I reduce PageControl flicker in Delphi?

时光总嘲笑我的痴心妄想 提交于 2019-11-29 19:06:41
问题 In Delphi 2009 I found that the flicker of a PageControl - which occurs during resizing of the form - can be reduced by setting its DoubleBuffered property to true. However if I add controls to the PageControl tabsheets, they will flicker regardless of their DoubleBuffered property setting. I have also tried with and without runtime themes enabled. 回答1: Setting ParentBackground to False for components on the PageControl helped a lot. However this results in a different color of these panel

How to implement thread which periodically checks something using minimal resources?

我的梦境 提交于 2019-11-29 17:24:35
问题 I would like to have a thread running in background which will check connection to some server with given time interval. For example for every 5 seconds. I don't know if there is a good "desing pattern" for this? If I remember corretly, I've read somewehere that sleeping thread in its execute method is not good. But I might be wrong. Also, I could use normal TThread class or OTL threading library. Any ideas? Thanks. 回答1: You could use an event and implement the Execute method of the TThread

Is there, or is there ever going to be, a conditional operator in Delphi?

▼魔方 西西 提交于 2019-11-29 10:41:21
问题 I kept my hands off Delphi for too long, I guess; busied myself with Java and PHP a lot over the last couple of years. Now, when I got back to doing a little Delphi job, I realised I really miss the conditional operator which is supported by both Java and PHP. On how many places would you find lines like these in your Delphi programs? var s : string; begin ...<here the string result is manipulated>... if combo.Text='' then s := 'null' else s := QuotedStr(combo.Text); result := result + s; end

Scope of anonymous methods

笑着哭i 提交于 2019-11-29 08:25:04
问题 One nice thing about anonymous methods is that I can use variables that are local in the calling context. Is there any reason why this does not work for out-parameters and function results? function ReturnTwoStrings (out Str1 : String) : String; begin ExecuteProcedure (procedure begin Str1 := 'First String'; Result := 'Second String'; end); end; Very artificial example of course, but I ran into some situations where this would have been useful. When I try to compile this, the compiler

How can I update a DataSnap server while clients are still connected?

天大地大妈咪最大 提交于 2019-11-29 07:22:30
We use stateful DataSnap servers for some business logic tasks and also to provide clientdataset data. If we have to update the server to modify a business rule, we copy the new version into a new empty folder and register it (depending on the Delphi version, just by launching or by running the TRegSvr utility). We can do this even while the old server instance is running. However, after registering the new version, all new client connections will still use the currently running (old) server instance . All clients have to disconnect first, then the new server will be used for the next clients.