delphi-2007

Duck typing in Delphi 2007?

半腔热情 提交于 2019-11-26 20:27:05
问题 Question: Is there a way to do duck typing with Delphi 2007 (i.e. without generics and advanced Rtti features)? Duck typing Resources for Delphi 2010 onward: Duck Duck Delphi in google project by ARCANA. Duck Typing in Delphi by Daniele Teti. AOP and duck typing in Delphi by Stefan Glienke. Last Edit: I've delved more into the resouces listed above and studied every posted answers here. I end up refining my requirement a made a follow up post to this question. 回答1: With the help of the

Convert Hi-Ansi chars to Ascii equivalent (é -> e)

北城以北 提交于 2019-11-26 19:29:46
问题 Is there a routine available in Delphi 2007 to convert the characters in the high range of the ANSI table (>127) to their equivalent ones in pure ASCII (<=127) according to a locale (codepage)? I know some chars cannot translate well but most can, esp. in the 192-255 range: À → A à → a Ë → E ë → e Ç → C ç → c – (en dash) → - (hyphen - that can be trickier) — (em dash) → - (hyphen) 回答1: WideCharToMultiByte does best-fit mapping for any characters that aren't supported by the specified

How to avoid issues when embedding a TForm in another TForm?

孤街醉人 提交于 2019-11-26 14:24:38
问题 I often embed a TForm descendant into another TForm descendant like this: var Form1: TForm1; Form2: TForm2; begin Form2.Parent := Form1; Form2.BorderStyle := bsNone; Form2.Align := alClient; Form2.Show; end; Usually this works just fine, but sometimes the controls in Form2 are not aligned properly. Is there a general workaround for this sort of problem? Does anybody know what is causing this "misalignment"? I know that I could use TFrame for this kind of job, but I have a lot of library code

Inter-process communication

大憨熊 提交于 2019-11-26 13:45:51
问题 I have two applications: X and Y. X is the main application and it handles a lot of XML files. It has a history of more than 10 years and half a dozen techniques have been used to store, process and handle these XML files. Y is a debugging tool that I am developing, which can process and display XML files in a more human-readable form. Basically, it just has a collection of stylesheets that will detect the XML format and if it recognizes the format, it will transform the XML to HTML which is

Why does CreateProcess give error 193 (%1 is not a valid Win32 app)

為{幸葍}努か 提交于 2019-11-26 08:36:47
问题 The code below fails to start documents. I get error 193 (%1 is not a valid Win32 app). Starting executables work fine. The files are properly associated, they start the corresponding app when double clicked. I have searched SO and elsewhere for the error message, createprocess stuff etc. (E.g. Why is CreateProcess failing in Windows Server 2003 64-bit? I know about quoting the command line. This is a Delphi XE2 (Update 4) Win32 app in a Win7 64bit VMWare VM. The code also fails on the host

List of Delphi language features and version in which they were introduced/deprecated

◇◆丶佛笑我妖孽 提交于 2019-11-26 02:39:53
问题 Before I begin, I would like to point out that I have honestly and genuinely searched repeatedly and exhaustively via Google for such a thing, and been unable to find one. I require (for a project I\'m developing) a list of all Delphi (2007 to the very latest released version, I no longer support any version older than 2007) \"Language Features\", and the versions in which they were introduced and (where applicable) deprecated, improved or removed. I have noted similar questions to this on