delphi-2007

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

冷暖自知 提交于 2019-12-05 19:55:26
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 this custom method: class function TXmlUtils.IsTextOrCDataElement(ANode: IXMLNode): Boolean; begin

Better multi-threaded debugging in the Delphi

孤人 提交于 2019-12-05 16:16:12
Leading on from the answer to another question about bugs in the Delphi IDE, does anyone know if there is a way to improve the multi-threaded debugging functionality of the IDE, or if not, at least why it is so bad on occasion? When you have multiple threads within a program, stepping through the code with F7 or F8 can often lead to either very long pauses, or the whole IDE just locks ups. This is especially apparent when you leave or enter a method or procedure. The debugger always seems to be fine for single threaded applications. PS. The version I'm using is 2007 From my experience multi

Clear a TList or a TObjectList

こ雲淡風輕ζ 提交于 2019-12-05 14:24:01
问题 I'm a bit puzzled of what to use for storing objects in a list. Until now I have used TList and freed each item in a loop. Then I discovered TObjectList that do this automatically from Free . Then I saw this from the doc of TList.Clear : Call Clear to empty the Items array and set the Count to 0. Clear also frees the memory used to store the Items array and sets the Capacity to 0. So it is basically the same. So for TList mylist.Clear; myList.Free; is the same as for TObjectList ? myList.Free

Delphi - inherit from a class and an interface (adapter pattern)?

社会主义新天地 提交于 2019-12-05 12:53:22
I am trying to do the GoF adapter pattern and in the C# example that I am following the Adapter class is inheriting the original class and an adapting interface. In Delphi (2007), as far as I know, this is not possible, or is it? Cause if a class is inheriting an interface, it needs to inherit from TInterfacedObject and since Delphi doesn't allow multiple class inheritance, that is the end of story. I cannot inherit from a custom class and an interface at the same time. Am I correct? Thank you. I have implemented this pattern on http://delphipatterns.blog.com/2011/02/22/decorator-5/ No that it

How to get the millisecond value from a Timestamp field in firebird with Delphi 2007

社会主义新天地 提交于 2019-12-05 10:31:15
I have a Firebird database (running on server version 2.1.3) and am connecting to it with Delphi 2007 using the DBExpress objects (using the Interbase driver) One of my tables in the database looks something like this CREATE TABLE MYTABLE ( MYDATE Timestamp NOT NULL, MYINDEX Integer NOT NULL, ... Snip ... PRIMARY KEY (MYDATE ,MYINDEX) ); I can add to the table OK, and in Flame Robin it shows the timestamp field as having a millisecond value. But when I do a select all ( select * from MYTABLE ) on the table I can not get the millisecond value, as it is always returned as 000. This causes major

ShareMem/ string-exchanging with Delphi DLL

拈花ヽ惹草 提交于 2019-12-05 09:35:55
问题 Quick one I hope - I'm just about to delve into a Delphi 5 legacy app that makes calls to a DLL (also written in D5), passing a string which the DLL can modify if required. I have the code to both the DLL and the app. Pasted right at the top of the DLL source is a remark about using ShareMem, and it needing to be the first line in the uses clause of the project etc. If I was porting this whole thing to D2007, is there a better (or more modern) way of getting a Delphi app to share string data

Delphi upgrade from RAD Studio to Delphi XE

拥有回忆 提交于 2019-12-05 07:28:32
We are thinking of upgrading from Rad Studio 2007 to Delphi XE and need to convince the boss that the cost is justified. I would appreciate comments that could help me answer the question: "What does Delphi XE bring to the table that makes it worth while to upgrade?" Regards, Pieter Check this white paper from Andreano Lanusse. Reasons to Migrate to Delphi XE – What you might have missed since Delphi 7 Inside of this document you can find a resume with the new features since delphi 7 or in your case since Delphi 2007. Delphi 2009 Unicode throughout the language, library and IDE Generics and

Encode base64 and Decode base64 using delphi 2007

故事扮演 提交于 2019-12-05 05:56:01
问题 I have to encode an array of bytes to a base64 string (and decode this string) on an old Delphi 2007. How could I do? Further Informations: I've tried synapse (As suggested here Binary to Base64 (Delphi)). 回答1: Indy ships with Delphi, and has TIdEncoderMIME and TIdDecoderMIME classes for handling base64. For example: uses ..., IdCoder, IdCoderMIME; var Bytes: TIdBytes; Base64String: String; begin //... Bytes := ...; // array of bytes //... Base64String := TIdEncoderMIME.EncodeBytes(Bytes); //

SSL Issues with IntraWeb - Delphi 2007

妖精的绣舞 提交于 2019-12-05 02:49:23
问题 I've been trying to SSL working on my IW program for the last little while and I keep running up against the 'Could not load SSL Library'. I've followed every piece of advice I could find on the subject, but still no joy. I've tried the suggested DLLs in both the local directory and in system32. Does anyone have a definitive answer about what OpenSSL DLLs I should be using? And what build of them? Or any other ideas at all? Indy: updated to the most recent snapshot yesterday IntraWeb: stock

How to make sure a dialog is always front of the main window

限于喜欢 提交于 2019-12-05 02:11:27
问题 I have not yet found the best solution for this. I have a non modal dialog that can be opened in unlimited instances by a hotkey in the application. Even the dialog itself can open a new instance. I want those dialogs to always be front of the main application window. I have tried a couple of things. Set FormStyle to fsStayOntop. This works but have the advantage that the dialog will be front of ALL windows even other applications. I only want it to be front of my main window. Set PopupMode