delphi-2007

Sorting multidimensional array in Delphi 2007

扶醉桌前 提交于 2019-12-24 02:13:29
问题 I have a multidimensional array similar to the one described below: Matrix => array( [0] => array( [0] => 7, [1] => 'hello' ), [1] => array( [0] => 3, [1] => 'there' ), [2] => array( [0] => 1, [1] => 'world' ), ) What I'm trying to achieve is to sort this array using the values of Matrix[i][0]. What would be the most efficient way to do this? I looked into the recursive QuickSort function possibility, but it's rather complicated as I'm multidimensional arrays. There are many examples of

Does TMonitor.GetBoundsRect have an access violation bug in Delphi 2007 triggered by VNC?

自古美人都是妖i 提交于 2019-12-24 01:54:06
问题 This is a crash report I get from customers running one of our big products built in Delphi 2007, that I am unable to reproduce and which doesn't even have any non-VCL code directly involved via the call stack. The VCL Source code for TMonitor in Delphi 2007 is very simple ( Forms.pas ) TMonitor.GetBoundsRect calls win32 API GetMonitorInfo after initializing a struct's cbSize so that the Windows API knows what size to return. I have been over and over this code and I can't see how this level

Delphi 2007 and Logitech Webcam Driver

♀尐吖头ヾ 提交于 2019-12-24 01:25:37
问题 A while ago I had this issue with Delphi 2007 unable to run and debug apps while the logitech webcam driver runs. Apparently the Logitech Driver inserts a stub into every process running, thereby messing up the debugger's offset. It's been a year and a bit - is this still an issue? Has Logitech cleaned up their act or do I have to dump my webcam for another brand? 回答1: According to Olaf Monien the problem still happening even in Delphi 2009 Apparently even with the latest Logitech drivers (11

How to intercept and suppress a message for a TFrame's subcomponent?

萝らか妹 提交于 2019-12-24 01:23:43
问题 I need to intercept the WM_PASTE message for a TEdit component which is placed inside a TFrame 's descendant class. If a condition is not satisfied, I want to iniby the paste operation. Is there a way to do this at the frame level? (I mean, without declaring a TEdit 's descendant) 回答1: Is there a way to do this at the frame level? (I mean, without declaring a TEdit 's descendant) WM_PASTE is sent directly to the TEdit window, the TFrame never sees it, so you must subclass the TEdit directly

How to use a TcxCustomDataSource in a TcxExtLookupComboBox?

白昼怎懂夜的黑 提交于 2019-12-23 18:15:47
问题 I use a TcxExtLookupComboBox from Devexpress and try to implement a custom datasource. I have set the customdatasource like this: procedure TMainForm.FormCreate(Sender: TObject); begin fDataSource := TMyDataSource.Create; cbotestSearch.Properties.View.DataController.CustomDataSource := fDataSource; end; TMyDataSource is defined here: unit Datasource; interface uses Classes, IBQuery, SysUtils, cxCustomData; type TSearchItem = class private BoldID: String; Display: String end; TMyDataSource =

Interface method as event handler

假装没事ソ 提交于 2019-12-23 13:06:43
问题 Is it possible to use interface method as event handlers in Delphi 2007? The simple versions don't work: type TMyEvent = procedure of object; IMyInterface = interface procedure Handler; end; TMyClass = class(TInterfacedObject, IMyInterface) public procedure Handler; end; var ev: TMyEvent; obj: TMyClass; intf: IMyInterface; begin obj := TMyClass.Create; intf := obj; ev := obj.Handler; // compiles ev := intf.Handler; // <== Error E2010 (incompatible types) end. Adding @ or Addr changes the

How do I avoid to call Application.CreateForm twice?

好久不见. 提交于 2019-12-23 09:56:05
问题 I stumbled on this page Why shouldn’t I call Application.CreateForm. Now I have some code like this: SplashForm := TSplashForm.Create(Application); SplashForm.Show; SplashForm.Update; // force update Application.Initialize; Application.CreateForm(TClientData, ClientData); SplashForm.Update; // force update Application.CreateForm(TClientMainForm, ClientMainForm); Application.ShowHint := True; Application.Run; ClientMainForm.ServerConnected := false; FreeAndNil(ClientMainForm); FreeAndNil

TIdHTTP - session has expired message under Delphi XE

自作多情 提交于 2019-12-23 07:16:28
问题 I am trying to port my code from Delphi 2007 to Delphi XE (no Update 1 yet). The problem which I have stumbled on is that under Delphi XE I am getting different response from server after sending second GET message. The message in formated HTML says that my session has expired. However, the same code works without any problems under Delphi 2007 up to this day. I have searched information over the internet and found out that I should use a CookieManager? The thing is that I am not using any in

Delphi 2007 Version Info missing from Exe

☆樱花仙子☆ 提交于 2019-12-23 02:59:07
问题 I have a Delphi 2007 project and I'm trying to set the Project->Options->'Version Info'. I enter the values into the form and save the project. However, when I build, the generated exe doesn't contain the Version Info that I entered. In fact, it only contains the File Version, Language and Product Version - none of the other values like Internal name, Product name etc... I noticed that the values do not get saved to the .dproj file. So I tried entering them manually into the xml of said file,

Why doesn't IXMLNode.IsTextElement return True for CDATA elements?

人走茶凉 提交于 2019-12-22 11:20:47
问题 We're using Delphi 2007 and the oxmldom Open XML provider. A normal situations input file looks similar to this: <root> <child>Some Text</child> </root> Now we have to process an input file that uses the CDATA node type: <root> <child><![CDATA[Some special Text]]></child> </root> Node.IsTextElement suddenly returns False , but Node.Text still works as expected. I know that IXMLNode.IsTextElement is just a convenience method, but I find this behavior rather odd. As a workaround we're now using