delphi-2009

EProgrammerNotFound exception in Delphi?

末鹿安然 提交于 2019-11-28 16:35:58
In Delphi 2009, SysUtils.pas contains this in line 425: EProgrammerNotFound = class(Exception); Is this simply an easter egg or something serious? When should this exception be raised? Does it also exist in Delphi Prism and/or Free Pascal? Q: Is this exception class still declared in Delphi (currently XE7)? A: Yes, and it is even documented ! Nonstandard way to indicate software faults. You can use EProgrammerNotFound as an alternative to indicate software faults detected at run time. It is just the result of a long day and we had gotten a little giddy. For many, many years (ever since I'd

How to use MS UI Automation in Delphi 2009

感情迁移 提交于 2019-11-28 13:01:49
I have a C# application, which uses Microsoft UI Automation functionality, e. g. a call like AutomationElement.RootElement.FindFirst(...) . Now I need to do the same thing (use MS UI Automation) in Delphi 2009. How can I a) declare that my Delphi code uses MS UI Automation library and b) make calls like AutomationElement.RootElement.FindFirst(...) ? There are several tutorials ( tutorial 1 , tutorial 2 ) explaining how to package one's own .NET code so that it can be used with Delphi, but in my case I need to use "pre-packaged" (already installed) assembly in Delphi. Update 1 Now I can get

Let components dropped on my control in the IDE become children of my control

不想你离开。 提交于 2019-11-28 12:46:47
I have a descendant of TWinControl (in fact it is just that for now) and I registered it as a component in the IDE: type TGroupPanel = class(TWinControl); But when I drop other components on it, they attach to the form instead of to my control. In other words, I want my custom control to behave like a TPanel so that components dropped on it become its children. If I create the components at runtime and assign them manually to my control, like in the code below, then it works: TForm1 = class(TForm) Group: TGroupPanel; procedure FormCreate(Sender: TObject); private Panel: TPanel; end; procedure

External Exception EEFFACE in Delphi

自作多情 提交于 2019-11-28 11:55:45
While debugging my application with Delphi 2009, I sometimes get the following exception occurring: (source: beholdgenealogy.com ) This only happens occasionally, but after pressing OK, then my IDE and program both may freeze. If I am lucky I can sometimes do a File/SaveAll in Delphi, but sometimes I can't. Either way I am stuck and then the only thing I can do is use Windows Task Manager to shut down Delphi. Of course, if I was unable to SaveAll, then I lose all the edits I had made since last saving. I have all the Delphi 2009 Updates installed right up to and including Update 4. I also have

MD5 Hashing in Delphi 2009

﹥>﹥吖頭↗ 提交于 2019-11-28 11:27:07
In borland delphi 7 and even in delphi 2007 everything worked, but in delphi 2009 it just returns the wrong hash! I use wcrypt2 script ( http://pastebin.com/m2f015cfd ) Just have a look: string : "123456" hash: Delphi 7 : "e10adc3949ba59abbe56e057f20f883e" - real hash. Delphi 2007 : "e10adc3949ba59abbe56e057f20f883e" - real hash too. And... Delphi 2009 : "5fa285e1bebe0a6623e33afc04a1fbd5" - WTF?? I've tried a lot of md5 scripts, but delphi 2009 does the same with all of them. Any help? Thanks. Your library is not Unicode aware. Just passing it an AnsiString won't be enough because it probably

How to read data from xml file and display it over the text box in delphi language

℡╲_俬逩灬. 提交于 2019-11-28 11:13:39
I am new to the delphi language, and here I have a doubt, I have a xml file called vehicle.xml. It looks like this <data> <vehicle> <type>Car</type> <model>2005</model> <number>1568</number> </vehicle> <vehicle> <type>Car</type> <model>2009</model> <number>1598</number> </vehicle> </data> My Delphi form contains three text boxes: txtType txtModel txtnumber While loading the page I want to display the contents of the vehicle.xml over the text box like: txtType=Car txtModel=2005 txtNumber="1568" Have a look at Delphi's own TXMLDocument component, for example: uses ..., XMLIntf, XMLDoc; procedure

Can I determine the order in which my units have been initialized?

和自甴很熟 提交于 2019-11-28 10:58:08
I am hunting a bug which might be connected to unit initialization order. Is there a way to see which initialization section was executed when? I need to know the order. This is during debugging, so I have the full power of the Delphi IDE, in my case Delphi 2009. I could set breakpoints, but this is rather tedious when having many units. Do you have any suggestions? For units in the interface uses list, the initialization sections of the units used by a client are executed in the order in which the units appear in the client's uses clause. see Online Help \ Programs and Units \ The

How to patch a method in Classes.pas

五迷三道 提交于 2019-11-28 10:14:40
I need to patch a method in Classes.pas (TReader.ReadString - I want to force it to use a specified codepage, not the system default). If I copy Classes.pas into my project,I will end up having to rebuild the entire VCL. Is there any (easy) way to patch a method at runtime? Modifying the implementation side of Classes.pas will not require recompiling everything. Delphi figures out if a unit needs to be recompiled by an algorithm that looks roughly like this: If DCU found: Is DCU format out of date (old version of compiler)? If so, need source to recompile or compile-time error. Is the source

Menu Accelerator Keys Not Showing Up (Delphi 2009)

回眸只為那壹抹淺笑 提交于 2019-11-28 09:22:46
I've tried my best and cannot figure out what happened here. It worked fine in Delphi 4. After upgrading to Delphi 2009, I don't know if this is the way it is supposed to work, or if it's a problem: This is what my program's menu looks like in Design Mode under Delphi 2009: Notice that every word in the Main Menu and the File submenu have one letter underlined. It is supposed to be like this. This underlined letter is called the Accelerator Key and is standard in Windows applications so that you can use the Alt-key and that letter to quickly select the menu item and then submenu item with the

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

女生的网名这么多〃 提交于 2019-11-28 01:15:17
问题 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