delphi-2006

Delphi - how do I find out which modal dialog has focus and bring it to the front?

喜你入骨 提交于 2019-12-21 04:28:14
问题 I have a Delphi 2006 app which can pop up a modal dialog in response to an error condition. It seems to get itself into a state where one of these modal dialogs is open, positioned in front of the main form, but neither form is responding to messages. Clicking on either gives a "bonk". The app is running fine, the UI is updating the main form, but you can't do anything. I guess there is most likely another modal dialog under the main form. Whether it is one of mine or one from Windows I have

How to avoid getting an error 10053 (WSAECONNABORTED) if a HttpGet operation in Android is lasting too long?

谁说我不能喝 提交于 2019-12-20 01:09:42
问题 I have an Android application communicating with a Delphi 2006 web service application using Indy 10 TIdHttpServer (coming with Delphi 2006). The Delphi application generates a big XML file and serves this. The XML generation may last more than 5 minutes. If the duration of GenerateXml() is more than about 5 minutes (*), I detect an error 10053 in TIdHTTPResponseInfo.WriteContent if running in the Delphi IDE: Socket Error # 10053 Software caused connection abort. However, on the android side

Get the list of ODBC data source names programatically using Delphi

故事扮演 提交于 2019-12-19 02:39:12
问题 I saw several examples where the list of the source names were took from registry (HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\ODBC Data Sources). Is there any other way to get the list of ODBC data sources names? I need to work only with Delphi standard components, so I can not use 3d party solutions. 回答1: You have to use SQLDataSources function from ODBC32.DLL. For example. 来源: https://stackoverflow.com/questions/7675412/get-the-list-of-odbc-data-source-names-programatically-using-delphi

How can I fix the TScrollBar MouseWheel malfunction?

天涯浪子 提交于 2019-12-18 12:42:22
问题 I have a TScrollBox inside of a TFrame and when I use my mouse's wheel it simply does not goes up nor down the ScrollBox scrolling. I have tried to use TScrollBox(Sender).Perform(WM_VSCROLL,1,0); on the FrameMouseWheelDown but it does not trigger. Any Ideas? 回答1: My scroll box looks like this: type TMyScrollBox = class(TScrollBox) protected function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; override; procedure WndProc(var Message: TMessage); override;

Unit testing in Delphi - how are you doing it? [closed]

我们两清 提交于 2019-12-17 17:24:54
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . I'm wondering how the few Delphi users here are doing unit testing, if any? Is there anything that integrates with the IDE that you've found works well? If not, what tools are you using and do you have or know of example mini-projects that demonstrate how it all works? Update

Delphi 2006 - What's the best way to gracefully kill a thread and still have the OnTerminate handler fire?

微笑、不失礼 提交于 2019-12-13 13:46:33
问题 I have a thread that sometimes freezes (I suspect) due to a DLL call that never returns. In the general case, where you have calls to blocking routines like Indy, is there a way of recovering from this in such a way that the thread OnTerminate handler fires? Will this happen if I call TerminateThread? 回答1: TerminateThread() is an immediate brute-force termination. It will NOT let the OnTerminaate event fire. The only way OnTerminate can fire is if the thread's Execute() method exits through

TDbLookupComboBox or equivalent control with a set of fixed values?

自闭症网瘾萝莉.ら 提交于 2019-12-13 09:19:41
问题 Does a TDbComboBox -like control exist, that gets its displayed values by an fixed list (to use for an enumerated type, e.g. TSomeValueEnum = (svSmall=1, svMedium=2, svLarge=3) )? With for instance: 1=small 2=medium 3=large In the database I save 1 or 2 or 3, but in the ComboBox only the corresponding value should be displayed. 回答1: Raize Components has a TRzDbComboBox where you have separate lists for Items and Values. From the help: The TRzDBComboBox does support a Values property, which

FastMM4, how to read the log file?

别等时光非礼了梦想. 提交于 2019-12-12 15:01:11
问题 i'am working on an software,so i have just started using FastMM4 (for real) in my project. i have found on the net on about how to get the line number in FastMM4,i got the line number but i can figure out what does the other information in the log means? i have this in the log file This block was allocated by thread 0x15F8, and the stack trace (return addresses) at the time was: 402E86 [system.pas][System][System.@GetMem][2648] 403A3B [system.pas][System][System.TObject.NewInstance][8824]

Delphi idle handler only fires when I move the mouse

拟墨画扇 提交于 2019-12-12 09:55:28
问题 I have an OnIdle handler in my D2006 app. With this code: procedure TMainForm.ApplicationEvents1Idle(Sender: TObject; var Done: Boolean); begin Inc (IdleCalls) ; Sleep (10) ; Done := False ; end ; the app runs smoothly, the idle handler is called 100 times per second, and the CPU usage is next to zero. I then added a TActionList and connected up some controls to actions, coded an Execute and Update handler. procedure TMainForm.ActionNewButtonExecute(Sender: TObject); begin DoNewProject ; end

How to fix owner draw anomaly in DBGrid?

折月煮酒 提交于 2019-12-12 09:29:38
问题 Continuing with the project started in: How to auto fit/scale DBGrid's (or other similar) columns widths according to its contents? I used the @alzaimar answer to auto fit the columns according to their content width, but he showed me how to increase the width, but not how to decrease, so I complemented the code as shown above: procedure TRecordsBrowserFrameBase.JvDBGrid2DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); var h, p, g,