delphi-xe2

RegisterPowerSettingNotification use in Delphi

假如想象 提交于 2020-02-16 07:01:26
问题 How to use the RegisterPowerSettingNotification in conjuction with GUID_MONITOR_POWER_ON in Delphi XE2? 回答1: You have to call RegisterPowerSettingNotification with the desired GUID Power Setting GUIDs to registers the application to receive power setting notifications for a specific power setting event, if not needed anymore the call UnregisterPowerSettingNotification. A delphi example could look like this: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics,

Hotel prices spanning multiple dates issue

霸气de小男生 提交于 2020-02-08 06:53:43
问题 Question is somehow related to this one, with the exception that I use parameters. I have this on my button click : procedure TForm1.Button1Click(Sender: TObject); begin with ABSQuery1 do begin ABSQuery1.Close; ABSQuery1.SQL.Clear; ABSQuery1.SQL.Add('select * from ROOM_RATES where CENIK_ID = :a4 and ROOM_TYPE = :A1'); ABSQuery1.SQL.Add('and rate_Start_DATE < :a3 AND rate_End_DATE > :a2 ORDER BY rate_Start_DATE ASC '); ABSQuery1.Params.ParamByName('a1').Value:= cxLookupComboBox2.Text;

onBeforeBrowse event in Delphi Chromium component

…衆ロ難τιáo~ 提交于 2020-02-07 00:00:30
问题 I'm trying to use following procedure in Delphi XE2 with Chromium component (version 306): procedure TForm1.Chromium1BeforeBrowse(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; navType: TCefHandlerNavtype; isRedirect: Boolean; out Result: Boolean); but it's not working. Delphi doesn't recognize onBeforeBrowse event. Chromium seems to be correctly installed, samples are working, and I'm trying to add onBeforeBrowse event handling in GuiClient

FM Mobile Destroy Form

本小妞迷上赌 提交于 2020-01-25 10:03:08
问题 How i can destroy form, I want: creatr Form1(start application), create Form 2, destroy Form1, working with form2, then create form 3, destroy form2. but I not know how to destroy form. If i call: procedure TFPressStartScreen.btn1Click(Sender: TObject); begin MainScreen.FMainScreen := MainScreen.TFMainScreen.Create(Application); MainScreen.FMainScreen.Show; DisposeOf; end; FPressStartScreen - 1 form, FMainScreen - 2 form, i create 2 form and need destroy 1. but i get access violation. 来源:

Windows & Mac XML library for delphi XE2

独自空忆成欢 提交于 2020-01-25 06:12:11
问题 What is the best (easy to use, performances) library to manage XML on Delphi XE2. Windows and Mac targets in mind. 回答1: You can use OmniXML, it is: 100% written in delphi Has no outer dependencies Works on XE2, did not test it on OSX On top of OmniXML you can use SimpleStorage to give you more power and simplicity managing the XML. 回答2: I usually go for the NativeXML library, it's an XML library completely written in Delphi code and it's free. I'm not sure if the latest version offers

Web request property “URL” is empty

流过昼夜 提交于 2020-01-25 01:44:17
问题 I'm trying to figure out how to read the full URI from a request ( Web.HTTPApp.TWebRequest ). There is a URL property, however it returns empty, and I don't see any more properties which could give me this. How can I get the complete URI of the request? This is being used via Indy 10 TIdHTTPWebBrokerBridge . For example... http://www.mydomain.com:18500/SomePath/SomeFile.html?n=v&a=b I tried tracking this URL property and found that in IdHTTPWebBrokerBridge.pas this is being left blank,

Is it possible to determine if the text in a dbEdit is longer than what is visible?

↘锁芯ラ 提交于 2020-01-22 14:38:30
问题 On some forms I have dbEdits that sometimes aren't wide enough to show all the text their fields may contain. For them I have the following code: procedure Tgm12edLots.dbeLotNameMouseEnter(Sender: TObject); begin with dbeLotName do begin ShowHint := True; Hint := Text; end; end; I'd like to avoid the hint showing if all the text is visible, but I don't how to test for that condition. Thanks for any tips/suggestions! 回答1: I think this should work... function CanShowAllText(Edit: TDBEdit)

Is it possible to determine if the text in a dbEdit is longer than what is visible?

对着背影说爱祢 提交于 2020-01-22 14:37:18
问题 On some forms I have dbEdits that sometimes aren't wide enough to show all the text their fields may contain. For them I have the following code: procedure Tgm12edLots.dbeLotNameMouseEnter(Sender: TObject); begin with dbeLotName do begin ShowHint := True; Hint := Text; end; end; I'd like to avoid the hint showing if all the text is visible, but I don't how to test for that condition. Thanks for any tips/suggestions! 回答1: I think this should work... function CanShowAllText(Edit: TDBEdit)

TRttiMethod.Invoke function doesn't work in overloaded methods?

空扰寡人 提交于 2020-01-20 05:05:15
问题 I'm creating an instance of a class using the TRttiMethod.Invoke function , but when the constructor or a method is overloaded, the rtti does not call the proper method. I wrote a sample app to ilustate my problem. program ProjectFoo; {$APPTYPE CONSOLE} {$R *.res} uses Rtti, System.SysUtils; type TFoo=class public constructor Create(Value : Integer);overload; constructor Create(const Value : string);overload; function Bar(value : integer) : Integer; overload; function Bar(const value : string

TRttiMethod.Invoke function doesn't work in overloaded methods?

浪尽此生 提交于 2020-01-20 05:04:45
问题 I'm creating an instance of a class using the TRttiMethod.Invoke function , but when the constructor or a method is overloaded, the rtti does not call the proper method. I wrote a sample app to ilustate my problem. program ProjectFoo; {$APPTYPE CONSOLE} {$R *.res} uses Rtti, System.SysUtils; type TFoo=class public constructor Create(Value : Integer);overload; constructor Create(const Value : string);overload; function Bar(value : integer) : Integer; overload; function Bar(const value : string