delphi-xe2

Why Jpeg is accepted in the uses clause in some projects and in others vcl.imaging.jpeg is required?

那年仲夏 提交于 2019-12-07 05:55:32
问题 I am updating some projects to XE2 and I don't understand why on some projects uses jpeg; is accepted and in other i need to write uses vcl.imaging.jpeg; Could you explain me please? 回答1: The difference is down to the the unit scope names setting in the project options for your various projects. If you have Vcl.Imaging included in that setting then you don't need to fully specify the unit scope. Typically, old projects that are upgraded from previous Delphi versions will have Vcl.Imaging

Delphi XE2: Invoke WinAPI EnumResourceNames cause access violation in Win64 platform

人盡茶涼 提交于 2019-12-07 05:34:39
问题 Running the following code in Delphi XE2 Win32 platform works. However, the same code compile in win64 platform will cause access violation in "EnumRCDataProc" if run in debug mode: procedure TForm2.Button1Click(Sender: TObject); function EnumRCDataProc(hModule: THandle; lpszType, lpszName: PChar; lParam: NativeInt): Boolean; stdcall; begin TStrings(lParam).Add(lpszName); Result := True; end; var k: NativeInt; L: TStringList; H: THandle; begin H := LoadPackage('resource.bpl'); L :=

How to get TExcelWorksheet (the 64-bit version) in XE2?

荒凉一梦 提交于 2019-12-07 04:29:27
问题 Delphi-XE2 does not seem to have a TExcelWorksheet component. How do I get the 64-bit version of this component installed? A download link somewhere would be way cool, but perhaps a import for Excel 2010 64 bit will also work? 回答1: You need to install the dclOffice2010160.bpl design time package. 来源: https://stackoverflow.com/questions/9740019/how-to-get-texcelworksheet-the-64-bit-version-in-xe2

Is there a function to shift degrees of a circle past 0?

眉间皱痕 提交于 2019-12-07 03:52:16
问题 I'm looking for a function somewhere in Delphi XE2 similar to Inc() which allows me to add/subtract a number of degrees from a current number of degrees and result in the new degrees. For example, if I have a point currently at 5 degrees around a circle, and I want to subtract 10, I should not get -5 degrees, but rather 355 (360 - 5). Same as adding past 360 - it should go back to 0 when it reaches 360. Is there anything like this already in Delphi so I don't have to re-write it? Perhaps in

How to show more than 200 rows in TStringGrid using LiveBindings?

随声附和 提交于 2019-12-07 02:50:44
问题 I have a TDataSource that is backed by a TClientDataset bound to a TStringGrid . I did this by right-clicking on the grid, selecting " Link to DB Datasource... ", and selecting the DataSource. This setup the LiveBindings for me. When I run the application, the grid only fills with 200 rows, even though there are 5000 records in the dataset. I'm unable to find any documentation regarding how to change the number of rows displayed or the proper way to allow the user to scroll through all of the

Delphi XE2: Why FireMonkey apps are HD?

感情迁移 提交于 2019-12-07 02:47:08
问题 According to release notes of Delphi XE2. FireMonkey may create HD application. HD stands for High Definition. Why HD? Can't VCL application create HD apps as FireMonkey? 回答1: Here is the documentation on Firemonkey, from it you can see several features. Compare normal TV to HD TV. Is like comparing the VCL to what Firemonkey can do. It's a Marketing term that I suspect will catch on as it, does highlight the power. HD Applications refer many of the features of Firemonkey but the following

TDownloadURL cannot download from HTTPS

不羁岁月 提交于 2019-12-07 02:13:33
问题 I've been trying to create (TFileStream) a PDF through the TDownloadURL class, but I'm really having troubles in obtaining the file/stream from the URL, specially if the URL a HTTPS. I'm not sure if I was clear, but I will post a snippet so it might help understanding: implementation var pdfStreamed: TDownloadUrl; var fileStream : TFileStream; procedure generateStream; begin pdfStreamed:= TDownLoadURL.Create(nil); with pdfStreamed do begin URL := 'https://farm9.staticflickr.com/8327

Can I check the Indy version installed?

夙愿已清 提交于 2019-12-07 02:08:53
问题 I need to use the latest Indy component library version. Can I get the library version by some source code command or any other trick to make sure I'm using the correct lib. I know I'm using the indy....160.bpl - this is what my Delphi XE2 says while moving the mouse over the component bar. The latest INDY lib I take from Fulgan Indy 回答1: How to get version of Indy by using an Indy component at runtime ? As @Remy pointed out in his comment, you can get the Indy version from any Indy component

Correct way to create styles for custom components

折月煮酒 提交于 2019-12-07 01:23:00
问题 I sort of asked this question at the end of another post but feel this topic needs a question of its own... If I have created my own component with its own .style what is the correct procedure to merge that with the defined styles supplied with Delphi without modifying the defaults? Can I embed a default style into a component I have created and can that embedded style inherit most of the style of its parent control? I feel that I am missing a link that I am struggling to describe. My

Record equality in generic collections

丶灬走出姿态 提交于 2019-12-06 23:29:07
问题 Assume you have a record with an overloaded equality operator TSomeRecord = record Value : String; class operator Equal(Left, Right : TSomeRecord) : Boolean; end; (implementation compares string values). If adding two records to the list that are equal based on the overloaded operator I would expect the Contains method to return true in both cases. But in fact, the generic list seems to just compare the memory content of records instead of applying the overloaded equality operator. var List :