delphi-xe2

Firemonkey and TDownloadUrl

核能气质少年 提交于 2019-12-11 14:16:51
问题 I have an (Delphi XE2) VCL app containing an object TDownloadUrl (VCL.ExtActns) to check several webpages, so I wonder if there is an equivalent object in FireMonkey, 'cause I wanna take advantage of rich features from this new platform. A Firemonkey app demo using threads would appreciate. Thanks in advance. 回答1: Actions don't exist yet with FireMonkey. BTW, you can create the same behavior with a code like this: IdHTTP1: TIdHTTP; ... procedure TForm2.MenuItem1Click(Sender: TObject); const

JVM created via JNI in Delphi creates multiple threads

若如初见. 提交于 2019-12-11 13:19:23
问题 I have a problem with the JNI and delphi. Whenever I create a JVM in delphi with this code: FillChar(Options, SizeOf(Options), #0); Options[0].optionString := '-Djava.class.path=' + 'blabla.jar'; VM_args.version := JNI_VERSION_1_2; VM_args.options := @Options; VM_args.nOptions := 1; JVM := TJavaVM.Create(JNI_VERSION_1_6, getJvmPath()); Errorcode := JVM.LoadVM(VM_args); I try to close the JVM with this code, but only 1 thread get closed: JNIEnv.Free; JNIEnv := nil; JVM.JavaVM^

Comparing records with operators

人盡茶涼 提交于 2019-12-11 12:34:26
问题 I've created a record which encapsulates scenarios of version numbers in an integer array and is interchangeable as a string... type TVersion = record Values: array of Integer; function Count: Integer; class operator implicit(aVersion: TVersion): String; class operator implicit(aVersion: String): TVersion; end; class operator TVersion.implicit(aVersion: TVersion): String; var X: Integer; begin Result:= ''; for X := 0 to Length(aVersion.Values)-1 do begin if X > 0 then Result:= Result + '.';

Serializing JSON object for an instance instantiated through a metaclass

*爱你&永不变心* 提交于 2019-12-11 11:52:50
问题 The SuperObject library has a generic method for serializing objects: type TSomeObject = class ... end; var lJSON : ISuperObject; lContext : TSuperRttiContext; lSomeObject : TSomeObject; begin lSomeObject := TSomeObject.Create; lContext := TSuperRttiContext.Create; lJSON := lContext.AsJson<TSomeObject>(lSomeObject); But now I'm dealing with metaclass instances. This is the object structure: TJSONStructure = class(TObject); TReqBase = class(TJSONStructure) private token: Int64; public end;

Delphi Form Switching using Timer

百般思念 提交于 2019-12-11 11:46:10
问题 I am a Delphi learner. A have a Project having 2 Forms("Form001" and "Form002"). There is a Button("BitBtn001") on "Form001". Both "Form001" and "Form002" is created by "FadeInTimer" and closed using "FormCloseQuery" by "FadeOutTimer". Both the Forms are minimized by "FormMinimizeTimer" and restored by "FormRetoreTimer". If I click on "BitBtn001" then "Form002" is shown. Here is the Download Link of my Project : The following is implementation logic : Form 001 : unit KoushikHalder001;

How do I support TLS 1.x only (in my webservice)?

為{幸葍}努か 提交于 2019-12-11 10:48:59
问题 I'm trying to control what TLS/SSL protocols are supported for a HTTPS connections to my webservice, by using a TIdServerIOHandlerSSLOpenSSL component and setting its SSLOptions.Method and SSLOptions.SSLVersions properties (as suggested in this answer). The default is Method sslvTLSv1 and SSLVersions [sslvTLSv1] (see this answer for the relations between Method and SSLVersions): I use nmap with the ssl-enum-ciphers.nse script from this answer to check what is actually available, and get this

Access to table fields

喜欢而已 提交于 2019-12-11 10:40:05
问题 In the following procedure by means of a conventional component of connection to the SQLite databases in Delphi XE3 I execute a SQL query to a database, containing fields with identical names from different tables. Then I address to this field through alias procedure CreationListOfFields(SQLConn: TSQLConnection; DBSchema : TDBSchemaSpec); var NameField : TField; PositionField : TField; DescriptionField : TField; CanInputField : TField; CanEditField : TField; ShowInGridField : TField;

Have cxGrid expand current date

ぐ巨炮叔叔 提交于 2019-12-11 09:48:29
问题 I made my grid group by date (grabbed the column name and dragged it to where it says 'group by that column'). However, when the grid is displayed all the dates are 'closed' so I must expand them to see data. That is OK but I wonder if it is possible to have current date expanded already (all other should remain closed !) so I do not have to click the expand cross? 回答1: try this, you can put the code in other event handler like a TButton for example procedure TForm1.FormCreate(Sender: TObject

How to display the latest news from a web news feed in delphi firemonkey application?

谁都会走 提交于 2019-12-11 08:25:14
问题 Well, I have a program and a website, the website has to part with the latest news, only formatted with CSS3, etc. .. I have no idea how to display in my delphi program the latest news, since the TWebBrowser is not transparent, can not render CSS3 and HTML5, has some other way? 回答1: Publish your news in an RSS feed. In your program, fetch that feed with something like Indy, extract the important parts with an XML parser, and present it however you want. You don't need to embed a Web browser

Can WinInet HttpQueryInfo return raw bytes? (HTTP Headers with unicode characters)

99封情书 提交于 2019-12-11 07:55:21
问题 The built-in routine HttpQueryInfo returns a string, not actual bytes. Normally that is not a problem. However, lately I have begin to encounter a problem with servers issuing redirects where the location header field contains an URL which includes non-percentage-encoded unicode/or? characters. Any way around this? var vContent_Wide: WideString; begin vBufferSize := 4096; GetMem(vBufferPtr, vBufferSize); while True do begin TmpFakeCardinal := 0; vErrorNone := HttpQueryInfo( hHttpOpen_Request,