delphi-xe3

Delphi XE3 EXE file size 25 times larger than Dephi 7

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 00:26:45
As a test I decided to create a simple "Hello world" app in Delphi using Delphi 4, 5, 6, 7, 2005, 2010 and XE3. The app is nothing more than a TForm, a TButton with an OnClick event that calls ShowMessage('Hello world'). Below are the results of each final EXE with debugging turned off: Can someone explain why the XE3 version is 26 times larger than the average of the previous versions of Delphi? Here are my project settings for XE3: You may have done a only a compile after changing to 'Release' configuration. Try to do a rebuild (not recompile). This will truly activate the Release

Delphi How to get default value for property using RTTI

不羁岁月 提交于 2019-11-29 16:17:24
If I have a class like this: TServerSettings = class(TSettings) strict private FHTTPPort : Integer; published property HTTPPort : Integer read FHTTPPort write FHTTPPort default 80; end; How can I get the default attribute of the HTTPPort property using RTTI? Like this: {$APPTYPE CONSOLE} uses System.TypInfo; type TMyClass = class strict private FMyValue: Integer; published property MyValue: Integer read FMyValue default 42; end; var obj: TMyClass; PropInfo: PPropInfo; begin obj := TMyClass.Create; PropInfo := GetPropInfo(obj, 'MyValue'); Writeln(PropInfo.Default); end. Note that the class as

Access Request Header in Delphi XE3 DataSnap Server

扶醉桌前 提交于 2019-11-29 15:02:18
问题 I am implementing a REST server API in Delphi XE3 (first time using Delphi in about a decade so am a bit rusty). Currently it is using Indy server for debug purposes, but eventually it will be an ISAPI dll. Now I have implemented a number of TDSServerClass classes and want to access the request header within the class methods. So for example when the user requests mysite.com/datasnap/rest/foo/bar I want to be able to read the header within the foo class method called bar. Is this possible? If

How to insert picture into TRichEdit in Delphi?

醉酒当歌 提交于 2019-11-29 14:59:28
I searched over internet for how to inserting picture in RichEdit . I only found inserting TImage into Richedit, or other 3rd part components to do it for me. I don't want to use other components or insert TImage into RichEdit. Is there any other way to do this? I want to insert it in line so I can use paragraph actions like justify on it (inserting TImage does not provide this as i found in examples and tested, am i wrong?). I want to write something like what happened in TJVRichEdit (in JVCL package) re-sizing picture in Richedit can be ignored. If you can wrap your image inside of an

How to show the sort arrow on a TListView column?

て烟熏妆下的殇ゞ 提交于 2019-11-29 14:20:44
Windows Explorer has an arrow indicating which column a list view (in report view style) is sorted by and in which direction (ASC vs. DESC). Is it possible to display such a sort indication arrow on a TListView in Delphi? David Heffernan Here's some simple code to mark a header column as sorted ascending: uses Winapi.CommCtrl; var Header: HWND; Item: THDItem; begin Header := ListView_GetHeader(ListView1.Handle); ZeroMemory(@Item, SizeOf(Item)); Item.Mask := HDI_FORMAT; Header_GetItem(Header, 0, Item); Item.fmt := Item.fmt and not (HDF_SORTUP or HDF_SORTDOWN);//remove both flags Item.fmt :=

How to show data at Fast Report in 3*3 grid format?

a 夏天 提交于 2019-11-29 12:40:23
I want to display data from table (column :- ID) at FastReport in Grid format as shown below. Suppose there are 22 records in table then it would display same in 3 * 3 grid at FastReport in following manner. I am using subreport at main page inside MasterData1 band. At subreport MasterData band is as follows MasterData1 band TfrxReportPage1 - Columns 2 Subreport - MasterData2 properties Columns 3 , RowCount 9 But when I previewed fast report it is just repeating same data in each grid on page as follows I am using frxDBDataSet1 to display data (Number Of Records 9). There are in total 28

How to detect modifier key change in a control which doesn't have focus?

為{幸葍}努か 提交于 2019-11-29 11:58:18
问题 Background: I'm working on a control derived from TCustomControl class which can get focus and which has some inner elements inside. Those inner elements are highlighted if the user hovers them with the cursor, you can select them, move them and so on. Now to the problem... Problem: I'm doing different actions with the (let's say) focused element if the user holds CTRL , ALT or SHIFT modifiers. What I would like is to change the mouse cursor if the user hovers the element and holds for

How to hide firemonkey application button from Taskbar (XE4)?

半腔热情 提交于 2019-11-29 08:46:28
According to this question it is possible to hide fmx taskbar icon by changing window style to WS_EX_TOOLWINDOW . In XE2 and XE3 this code works: uses FMX.Platform.Win, Winapi.Windows; procedure TForm1.Button1Click(Sender: TObject); var h:THandle; begin h := FmxHandleToHWND(Handle); ShowWindow(h, SW_HIDE); SetWindowLong(h, GWL_EXSTYLE, GetWindowLong(h, GWL_EXSTYLE) or WS_EX_TOOLWINDOW); ShowWindow(h, SW_SHOW); end; In XE4 this solution does not work (application button should become hidden but nothing happens). any body have any idea? Thanks. Steve Swallow Just tried this in XE7 and of course

How to display BLOB Image from database in the TAdvStringGrid with the help of DataSet

梦想与她 提交于 2019-11-29 08:42:46
I have been making an application at Delphi XE3. I am trying to display values from database to the TAdvStringGrid component placed on the form. I am using dataset to display results at TAdvSTringGRid (code is given below). All other values are displaying perfectly except Image in database. Where it is expected to show image, it is showing junk characters. How to display image perfectly from DataBase at TAdvStringGrid. SQLConnection1: TSQLConnection; SQLMonitor1: TSQLMonitor; DataSource1: TDataSource; ADOConnection1: TADOConnection; ClientDataSet1: TClientDataSet; AdvStringGrid1:

How to calculate elapsed time of a function?

无人久伴 提交于 2019-11-29 06:23:56
问题 I would like to know how to calculate the time consumed for a function in Delphi. Then I wanted to show the used time and compare it with another function or component so as to know the faster function. 回答1: You can use TStopwatch from the System.Diagnostics unit to measure elapsed time using the system's high-resolution performance counter. var Stopwatch: TStopwatch; Elapsed: TTimeSpan; .... Stopwatch := TStopwatch.StartNew; DoSomething; Elapsed := Stopwatch.Elapsed; To read a time value in