delphi-2009

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

给你一囗甜甜゛ 提交于 2019-12-17 19:38:49
问题 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

Delphi 2009 - create a TPanel at runtime and change its color

给你一囗甜甜゛ 提交于 2019-12-17 16:44:19
问题 got a strange problem: I create a TPanele at runtime and change its color - however, the color is still clBtnFace. Here' the code: procedure TForm1.Button1Click(Sender: TObject); var pnlTest : TPanel; begin pnlTest := TPanel.Create(Form1); pnlTest.Parent := Form1; pnlTest.Width := 100; pnlTest.Height := 100; pnlTest.Color := clRed; end; Any ideas? Thanks! 回答1: When you want to have colored panels under a themed OS you have to set ParentBackground to False. 回答2: Try this :-) procedure TForm1

How to get a stack trace from FastMM

喜夏-厌秋 提交于 2019-12-17 15:44:09
问题 I've noticed in the following post that you can get a stack trace out of FastMM to show what appears to be where an object was allocated: How to track down tricky memory leak with fastMM? I can't find any information on how to enable this in Delphi 2009, though. I have set ReportMemoryLeaksOnShutdown to true so I get the basic report, but how do I get the stack trace report? 回答1: The internal Delphi version of FastMM doesn't support stack traces. If you want to log the memory leak stack

Delphi MSBuild Build Configurations From Command Line

淺唱寂寞╮ 提交于 2019-12-17 15:25:08
问题 Delphi 2009 uses build configurations . When you create a new project you have two default build configurations "Debug" and "Release". Now I asked myself how to automate builds using MSBuild (which is supported by Delphi since version 2007). You can start the "msbuild" command in the "RAD Studio Command Prompt" in some Delphi project directory and it will build the default build configuration (the last activated build configuration inside the Delphi IDE). Now, I want to specify a certain (non

Step by step upgrade of Indy 10 in Delphi 2009

送分小仙女□ 提交于 2019-12-17 07:26:22
问题 Can someone help in telling the details on how to uninstall Indy 10 and install the latest build? I found it http://indy.fulgan.com/ZIP/IndyTiburon.zip There is a similar question, but not a satisfying answer, just some comments from the user who asked, but that is not a step by step guide. Why there is not a tool for this? 回答1: I did this very recently, I've done it before with 2007 and had lots of problems, but this time in D2010 it went really well... Assumptions: The Indy BPL's are stored

How do I make a PNG resource?

和自甴很熟 提交于 2019-12-17 07:11:22
问题 I've got a form with a large TImage on it as a background. Problem is, this is stored directly in the DFM as a bitmap, which takes up about 3 MB. The original PNG file is ~250K. I'd like to try to reduce bloat by embedding the PNG in a resource, and then having the form load it during OnCreate . I can do that now that Delphi 2009 includes PNG support, except I don't quite know how to build a resource file with a PNG in it. Anyone know how that's done? 回答1: Example text file (named myres.rc):

Which variables are initialized when in Delphi?

北城余情 提交于 2019-12-17 03:55:19
问题 So I always heard that class fields (heap based) were initialized, but stack based variables were not. I also heard that record members (also being stack based) were also not initialized. The compiler warns that local variables are not initialized ([DCC Warning] W1036 Variable 'x' might not have been initialized), but does not warn for record members. So I decided to run a test. I always get 0 from Integers and false from Booleans for all record members. I tried turning various compiler

Why Delphi Excel OLE functions does not correspond to the specificiation?

我只是一个虾纸丫 提交于 2019-12-14 03:32:21
问题 I am trying to copy-paste from one Excel into another Excel programmatically from the Delphi code, the extded question and the source code is in Excel Copy-Paste from Delphi (OLE) with all the formatting? It is possible to copy-paste the column-width and data&formatting in Excel applications following https://www.extendoffice.com/documents/excel/1867-excel-copy-column-width.html using 2 consecutive operations from the Excel applications: 1) Paste Special... - Other Paste Options - Column

Accessing icons in a 64bit exe with a 32bit program?

Deadly 提交于 2019-12-14 02:40:55
问题 Is there any way to access 64bit exe-files with a 32bit app? I am using Delphi 2009 (upgrade to XE2 is not possible, moneywise, right now) I am making this launcher, and when running it on win7 64bit, it doesn't pickup the right icons for 64bit apps, and ShellExecute doesn't seem to work either with those apps. Now, all these apps are in "C:\program files" which suggests that this is a WOW64 thing. I have googled various ways to temporarily disable wow-redirection, but none seems to work. 来源:

How to catch WM_DEVICECHANGE in a control other than TForm?

ぃ、小莉子 提交于 2019-12-14 02:33:21
问题 Until today I was using the following code to catch WM_DEVICECHANGE message in application main form and it worked pefectly. But if I try to use this in my custom control I don't get notifyed on device insert or remove. What is happening ? TDriveBar = class(TCustomPanel) private procedure WMDeviceChange(var Msg: TMessage); message WM_DEVICECHANGE; end; implementation procedure TDriveBar.WMDeviceChange(var Msg: TMessage); const DBT_DEVICEARRIVAL = $8000; DBT_DEVICEREMOVECOMPLETE = $8004; DBT