delphi-xe2

Converting Delphi 7 property editor to Delphi XE2

拥有回忆 提交于 2019-12-07 19:10:27
问题 First of all, I have never written a property editor from scratch, but had some help with one in another question. Refer to the accepted answer there. This was in Delphi 7, and now I have started using XE2 and I have to make sure my property editor is compatible with both 7 and XE2. It's essentially a collection editor, with the difference that each collection item has its own named component in the parent form. Is there anything new about the property editors in XE2 since 7, since it is a

Can i call a web service from FireMonkey for iOS?

喜夏-厌秋 提交于 2019-12-07 17:51:11
问题 I'm new to iOS, have been developing in Delphi for many years. I don't know FPC well and i find it very hard to figure out which classes are available on iOS. is there any FireMonkey classes for calling web services and parsing xml? 回答1: Yes you can call a webservice :) No it is not simple :( You need to access the iOS framework directly... The following code fragments will help... First a pascal example of how to send/receive data via TCP https://forums.embarcadero.com/thread.jspa?messageID

List and Contains method

流过昼夜 提交于 2019-12-07 13:05:06
问题 i have this problem: starting from an empty list (0 elements) i want check if an element is present or not present in this list. In case this record not is present in list then i add this record to list, otherwise update element in list. I have tried writing this code: program Project1; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, System.Generics.Collections, System.Generics.Defaults; type TDBStats = record Comb: Integer; Freq: Integer; end; TDBStatsList = TList<TDBStats>; procedure

How can I fixate form for tablet PC in Delphi XE2?

爱⌒轻易说出口 提交于 2019-12-07 12:05:19
问题 I have a problem. I create a fullscreen form in Delphi XE2. Then I run my application on tablet PC with windows 7 on board where screen resolution is 1024x600. Then I rotate tablet PC (now resolution is 600x1024) and I had some problems with elements on form (some buttons are behind the screen, etc.). Can I configure project so that when I turn the tablet PC my form is not rotate? 回答1: According to this MSDN article you can detect that the screen has been rotated by listening for the WM

F2051 Unit JclUnitVersioning was compiled with a different version of System.Contnrs.TObjectList.Remove

一曲冷凌霜 提交于 2019-12-07 11:32:23
I'm migrating a Delphi 2 project to RAD Studio XE2. When I try to compile I get [DCC Fatal Error] MyUnit.pas(9): F2051 Unit JclUnitVersioning was compiled with a different version of System.Contnrs.TObjectList.Remove at the following row: unit MyUnit; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, DB, DBTables, TB97, ExtCtrls, Grids, DBGrids, Vcl.Mask, JvExMask, Vcl.DBLookup, JvToolEdit, {<-- error here} TB97Ctls; {...} I tried uninstalling and reinstalling RAD Studio, JCL and JVCL, but nothing changes. Update Was using the binary Jedi

Good quality code example of how to call an application and wait for it to exit

久未见 提交于 2019-12-07 09:22:42
问题 Using: Delphi XE2; Windows 32-bit VCL application From within my Delphi application, I need to call an application using ShellExecute and wait until it finishes before proceeding. I see many examples here on SO of ShellExecute with MsgWaitForMultipleObjects but can't know which one is the best because they are mostly doing what is not recommended ie. also using Application.ProcessMessages which is not recommended by many. I see an answer by NFX here in this post which does not use Application

Val does not work with UInt64?

拟墨画扇 提交于 2019-12-07 08:20:21
问题 just curious why the following code fails to convert uint64 value in string representation ? var num: UInt64; s: string; err: Integer; begin s := '18446744073709551615'; // High(UInt64) Val(s, num, err); if err <> 0 then raise Exception.Create('Failed to convert UInt64 at ' + IntToStr(err)); // returns 20 end. Delphi XE2 Am I missing something here ? 回答1: According to the documentation, S is a string-type expression; it must be a sequence of characters that form a signed real number. I agree

What does TDataModule.ClassGroup pseudo-property in Delphi XE2 really do?

懵懂的女人 提交于 2019-12-07 07:55:13
问题 I tried to copy and paste a component from one data module into another in Delphi XE2. The component was a Fast Report data source link component. The data module was brand new, just created that second, in XE2. Someone else had the same problem and reported it on quality central as 106369 and same error message leading me to this mysterious DocWiki entry. So data modules now have a framework affinity, and a designtime-only pseudo property, which according to the docs: "Because the ClassGroup

Color VirtualStringTree rows with hidden nodes

丶灬走出姿态 提交于 2019-12-07 07:30:39
问题 I'm currently using this code in the OnBeforeCellPaint event of my tree: if Node.Index mod 2 = 0 then begin TargetCanvas.Brush.Color := clBlack; TargetCanvas.FillRect(CellRect); end else begin TargetCanvas.Brush.Color := clPurple; TargetCanvas.FillRect(CellRect); end; To color my nodes. But with hidden nodes this doesn't work as the index stays the same. Is there an visible index or an easy workaround? Thanks in advance. 回答1: There is no such method to get visibility node index at this time.

How to pass a parameter to a query using dbExpress in Delphi

南笙酒味 提交于 2019-12-07 07:21:01
问题 I want to use a dbExpress TSQLQuery component. But i do not know how to write the SQL to add a parameter. I will give an example maybe it will be more clear what my problem is. In a TADOQuery the following works: SELECT* FROM sometable WHERE sometable.id = :value; Now in the above example you pass the parameter to the query using the colon (:) before the parameter name. But when I try and do that with the TSQLQuery, I get the following error: dbExpress driver does not support the TDBXTypes