delphi-2007

Delphi 2007 : How to Set TSAWARE?

痞子三分冷 提交于 2020-01-22 19:52:07
问题 In Delphi 2009 and up you can add this line to your project .dpr to set the TSAWARE PE flag in your application executable: {$SetPEOptFlags IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE} I thought (wrongly) that this syntax is not supported in Delphi 2007. I have an application that I cannot port from 2007 to a newer Delphi version just yet (the task is underway, but it will not be done in the next few months). Update it was simply that Windows must be added to the project .dpr also. 回答1: My

Delphi Chromium - Iterate DOM

你说的曾经没有我的故事 提交于 2020-01-21 08:45:08
问题 I'm trying to iterate the DOM using TChromium and because i use Delphi 2007 i can't use anonymous methods, so i created a class inherited of TCEFDomVisitorOwn. My code is as below, but for some reason the 'visit' procedure is never called, so nothings happens. unit udomprinc; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ceflib, cefvcl; type TForm1 = class(TForm) Chromium1: TChromium; procedure FormCreate(Sender: TObject); procedure

Delphi Chromium - Iterate DOM

末鹿安然 提交于 2020-01-21 08:43:09
问题 I'm trying to iterate the DOM using TChromium and because i use Delphi 2007 i can't use anonymous methods, so i created a class inherited of TCEFDomVisitorOwn. My code is as below, but for some reason the 'visit' procedure is never called, so nothings happens. unit udomprinc; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ceflib, cefvcl; type TForm1 = class(TForm) Chromium1: TChromium; procedure FormCreate(Sender: TObject); procedure

How to properly define a TCustomFrame's child class?

拥有回忆 提交于 2020-01-15 06:13:45
问题 I'm trying to define a child class of TCustomFrame but I get an error on TabOrder property. These are steps I've followed: Add a new TFrame descendant to the form (Right click on project, add new, other, frame). Switch the parent class from TFrame to TCustomFrame. TMyFrame = class(TCustomFrame) Check TFrame definition and publish exactly the same properties (Doing so, TMyFrame should be identical to TFrame, right?). Save and close. Open unit in which TMyFrame is defined. It gets an error

Mimic outside click on a popup menu

[亡魂溺海] 提交于 2020-01-04 06:31:31
问题 You know how in a popup menu if you click outside of the menu the popup disappears? Well I would like to reproduce that. Currently I am having a panel created with some components on it when a button is clicked. The panel and sub components go away when you click a certain button on the panel. However I want it to go away if you click anywhere outside of the panel. 回答1: I think you would need to install and application-wide mouse message hook, and if your panel is visible and the coordinates

Why doesn't my program recognize mapped UNC paths?

筅森魡賤 提交于 2020-01-03 12:31:09
问题 I have some problems writing to a mapped network drive (P:) in Windows 7 from my Delphi program. When I try, for example, ForceDirectories('P:\test\folder') , I get an error (path not found). I have tried typing in the UNC path in the code ( ForceDirectories('\\computername\share\test\folder') ) and that works. However, ExpandUNCFileName('P:\') does not seem to work; it returns 'P:\'. On Windows XP, ExpandUNCFileName('P:\') returns the UNC path. How do I get the UNC path in Delphi on Windows

Delphi XML traversing

扶醉桌前 提交于 2020-01-02 06:13:09
问题 I am new to Delphi. I wanted to find all the authors under each subject. Here is my XML <?xml version="1.0"?> <catalog> <subject id="computer"> <book id="bk101"> <author>Gambardella, Matthew</author> <title>XML Developer's Guide</title> <genre>Computer</genre> <price>44.95</price> <publish_date>2000-10-01</publish_date> <description>An in-depth look at creating applications with XML.</description> </book> <book id="bk112"> <author>Galos, Mike</author> <title>Visual Studio 7: A Comprehensive

Equivalent to designer guidelines in code

核能气质少年 提交于 2020-01-02 01:07:06
问题 The VCL form designer offers pink guidelines for aligning controls at their respective text base lines: But as far as I can tell this doesn't work for labels and checkboxes. Update: It works for labels if you place the controls exactly , e.g. by Ctrl - arrow . It kind of works for checkboxes - see screenshot. Now, on some forms I'm creating controls in code, e.g. ed := TEdit.Create(Self); ed.SetBounds(...); ed.Parent := SomePanel; etc. How can I ensure that their text base lines are aligned?

How can I communicate with WCF from Delphi using Named Pipes Binding

人走茶凉 提交于 2020-01-01 12:12:11
问题 Can I use Delphi 2007 to communicate with a WCF service using the netnamedpipebinding ? If so, then how? 回答1: I suggest that you create a COM-visible proxy for your service using .NET (and WCF!), then consume it from Delphi as you would any COM object. There are several reasons why implementing a native client for a WCF service listening on a NetNamedPipesBinding endpoint is extremely complex. See http://blogs.charteris.com/blogs/chrisdi for more details. 回答2: Yes, you should be able to do

How to Append rows to an Excel Sheet?

左心房为你撑大大i 提交于 2020-01-01 07:08:26
问题 I am developing an application that need to generate excel sheets. How do we append rows to an existing excel sheet? I am using Delphi 2007.(and I am using SM Software TXLS... components...but I am ok with answers in native delphi excel components). Thanking you all, Pradeep 回答1: Over the years, I've found Deborah Pate's site has helped me by providing useful code samples: http://www.djpate.freeserve.co.uk/AutoExcl.htm. We use the CreateOleObject approach. 回答2: Normally you won't need to