delphi-2009

Closing a secondary delphi form causes the main form to lose focus

a 夏天 提交于 2019-12-11 00:49:12
问题 When showing a secondary form from the main form and from the second form showing a third form and then closing both forms will cause the main form to lose focus. Using Delphi 2009 with XP SP3 Here are my steps for reproducing the problem: Create a new VCL forms applications Drag a button onto the created form In the click handler create a new TForm1 and show it Run the program. Click the button to show a second form. Click the button on the second form to create a third form. When closing

TIdTCPServer not reading data from socket sometimes

时间秒杀一切 提交于 2019-12-10 23:08:21
问题 I have the following code in the OnExecute of a TIdTCPServer (Delphi 2009 and Indy 10 that came with the installation) which is very similar to other examples on this site; Socket := AContext.Connection.Socket; if Socket.CheckForDataOnSource(10) then begin if not Socket.InputBufferIsEmpty then begin Socket.InputBuffer.ExtractToBytes(RawBytes, -1, False, -1); SetLength(Buffer, Length(RawBytes)); Move(RawBytes[0], Buffer[1], Length(RawBytes)); // Do stuff with data here... end; end; AContext

Anonymous method as function result

。_饼干妹妹 提交于 2019-12-10 21:04:46
问题 What I want to do is to assign an anonymous method which I get as a function result to a variable of the same type. Delphi complains about not beeing able to do the assignement. Obviously Delphi things I want to assign the "GetListener" function instead of the result of that same function. Any help with this is very much appreciated. type TPropertyChangedListener = reference to procedure (Sender: TStimulus); TMyClass = class function GetListener:TPropertyChangedListener end; .... var MyClass:

Delphi 2009 (and probably Delphi 2010 as well) and QTP

青春壹個敷衍的年華 提交于 2019-12-10 20:18:07
问题 We have a suite of automatic tests written in QTP (Quick Test Pro - an HP product), and we have just upgraded to Delphi 2009 (I know we are late adopters), and all of these tests no longer work. The plugin that QTP have released does not work with Delphi 2009 - we have that in writing now from HP. Do you know of (a) anyone else in the same boat as us (b) anyone have a work around, as I can't see one and HP don't seem to be too proactive about this. Any help would be appreciated. 回答1: I hate

Relative paths in Delphi projects and ITE in particular

青春壹個敷衍的年華 提交于 2019-12-10 20:02:33
问题 I've a bunch of projects with some common libraries in a SVN repository. The repository has some branches for in-production versions. For this reason (checking out several versions on one computer, and minimizing swap time), I tried to configure all projects as much as possible with relative paths within the repository. (....\libraries\common for forms in .dpr and library searchpaths). This is not 100% ideal (it occasionally gets confused if you file->open and browse to a different dir, but

Delphi - MySQL Best Data aware components to use

别来无恙 提交于 2019-12-10 18:52:20
问题 I need my application to connect to my web server's MySQL database, what is the best option for this. Perfered Data aware Component. I tried zeos 7, but I keep getting the error: SQL error: Client does not support authentication protocol requested by server; consider upgrading MySQL client and have not been able to fix it. Thanks -Brad 回答1: @Brad the ZEOS components are an excellent alternative for connect to MySQL, you have that error because you are using an older version of MySQL client.

How to disable automatic appending of wildcard pattern in Vista file open dialog

喜夏-厌秋 提交于 2019-12-10 17:05:47
问题 I'm using a file open dialog to chose image files for further editing. The filter list contains an "All supported formats" entry which represents a long list of file formats. Since Vista automatically appends the wildcard patterns in the filter combobox, the expanded combobox is too wide to fit completely on the screen. Besides that it doesn't look very well. So is it possible to disable this behaviour and let Vista display the original filter string? Regards, Daniel 回答1: Vista only appends

How to modify/replace option set file when building from command line?

喜夏-厌秋 提交于 2019-12-10 15:28:10
问题 I build packages from a batch file using commands like: msbuild ..\lib\Package.dproj /target:Build /p:config=%1 The packages' settings are dependent on an option set: <Import Project="..\optionsets\COND_Defined.optset" Condition="'$(Base)'!='' And Exists('..\optionsets\COND_Defined.optset')"/> This option set defines a conditional symbol many of my packages depend on. The file looks like this: <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <DCC_Define

How to identify unicode keys on key press?

前提是你 提交于 2019-12-10 15:14:52
问题 My application uses unicode characters and i have several text fields where i want to restrict user from inputing special characters like :'"; begin if not (Key in ['a'..'z','A'..'Z',' ','0'..'9',#13,#8]) then Key := #0; if Key = #13 then bOk.Click; end; So at this point it lets user add spaces and use a backspace key to erase, and of course Enter key to comfirm. There are few unicode characters i want to let being inputed also. ą, č, ė, į, š, ų, ū, ž and their uppercase alternatives, but

Install the latest build of Indy 10 on Delphi 2009 [duplicate]

杀马特。学长 韩版系。学妹 提交于 2019-12-10 14:46:21
问题 This question already has an answer here : Step by step upgrade of Indy 10 in Delphi 2009 (1 answer) Closed 5 months ago . Is there a step-by-step guide for updating the Indy 10 components in Delphi 2009? I've read the uninstalling thread and have the latest build (IndyTiburon.zip). However there appears to be no installation instructions. If you have accomplished this, please share the details. Edit: I have managed to get the packages installed by messing with the "requires" section in