delphi-xe2

delphi - how to pass a parameter from the instantiator to a constructor in the spring4d dependency injection framework?

和自甴很熟 提交于 2020-01-10 14:19:06
问题 It's possible to register a class with a parameter expected to be passed from the point of creation? I know it can be done something like this: GlobalContainer.RegisterType<TUserProcessor>.Implements<IUserUpgrader>. AsTransient.DelegateTo( function: TUserProcessor begin Result := TUserProcessor.Create(GetCurrentUser); end ); But there the parameters are binded to the execution context where the container gets registered and not where the object get's intantiated. Something like this it's

SuperObject cannot handle null string

六月ゝ 毕业季﹏ 提交于 2020-01-09 11:24:11
问题 Some JSON serializers return null for an empty string datafield, e.g. { "searchtext": null, "moretext": "contains something", "bookdate": 1377468000000, "empid": 12345, "listtype": 1 } I'm using SuperObject to create a ISuperObject: var FJSONRequest: ISuperObject; then FJSONRequest := SO(Request.Content); // Webservice request This returns an object with a string containing the text 'null' . Obviously this is because SuperObject does not care about the quotes ( "searchtext": a gives the same

SuperObject cannot handle null string

独自空忆成欢 提交于 2020-01-09 11:24:01
问题 Some JSON serializers return null for an empty string datafield, e.g. { "searchtext": null, "moretext": "contains something", "bookdate": 1377468000000, "empid": 12345, "listtype": 1 } I'm using SuperObject to create a ISuperObject: var FJSONRequest: ISuperObject; then FJSONRequest := SO(Request.Content); // Webservice request This returns an object with a string containing the text 'null' . Obviously this is because SuperObject does not care about the quotes ( "searchtext": a gives the same

Delphi: Simulating a drag and drop from the clipboard to EmbeddedWB’s IHTMLElement

人盡茶涼 提交于 2020-01-07 03:00:55
问题 I have a Delphi XE2 application with a TEmbeddedWB that I use to simulate user actions. The application navigates to a URL, populates the relevant form fields with data and submits the data. The problem is that there is an <input type=file /> field which accepts files that are uploaded. Having done a lot of reading on the matter I understand there is a security issue doing this programmatically but also found someone making a suggestion that the files could be ‘dragged’ from the clipboard and

Retrieve default internet timeout values?

て烟熏妆下的殇ゞ 提交于 2020-01-05 16:49:02
问题 I'm trying to retrieve the default values for the INTERNET_OPTION_SEND_TIMEOUT , INTERNET_OPTION_SEND_TIMEOUT , and INTERNET_OPTION_RECEIVE_TIMEOUT options flags. From what I read, they are in WinInit. The below code fails to compile with Types of actual and formal var parameters must be identical , but which parameter is incorrect here? procedure TFrmWininetTimeOuts.FormShow(Sender: TObject); var hSession : HINTERNET; dwTimeOut : DWORD; begin hSession := InternetOpen('usersession', INTERNET

Only One CheckBox Checked at a time

最后都变了- 提交于 2020-01-05 09:23:41
问题 [Compiler: Delphi XE2] I have spent all day yesterday trying all sorts of ways to accomplish this specific task but they have all ended in the same result. Using TRZCheckGroup and this example to see what has been checked ect.. procedure TFrmMain.cbOptionsChange(Sender: TObject; Index: Integer; NewState: TCheckBoxState); var ItmIndex0, ItmIndex1: Integer; begin { Initialize ItemIndex's } ItmIndex0 := -1; ItmIndex1 := -1; { Return the position Index of the string's(0 and 1) } ItmIndex0 :=

Only One CheckBox Checked at a time

廉价感情. 提交于 2020-01-05 09:22:43
问题 [Compiler: Delphi XE2] I have spent all day yesterday trying all sorts of ways to accomplish this specific task but they have all ended in the same result. Using TRZCheckGroup and this example to see what has been checked ect.. procedure TFrmMain.cbOptionsChange(Sender: TObject; Index: Integer; NewState: TCheckBoxState); var ItmIndex0, ItmIndex1: Integer; begin { Initialize ItemIndex's } ItmIndex0 := -1; ItmIndex1 := -1; { Return the position Index of the string's(0 and 1) } ItmIndex0 :=

TurboPower B-Tree Filer and Delphi XE2 - Anyone done it?

穿精又带淫゛_ 提交于 2020-01-05 07:27:47
问题 I might be the last guy on the planet relying on B-Tree Filer but I made the jump from Delphi 2007 to XE2. After getting over all the AnsiChar and PAnsiChar issues, the code now crashes with a Range Check with zero items on a page. Is anyone successfully running B-Tree Filer under Delphi XE2? If so, how'd ya do it? :) Update Range check error here: procedure IsamUnPack(var Page : IsamPage; KeyL : Word); var I, K, S : Word; P : Array [0..0] Of Byte absolute Page; {Real bounds [0..65535]} begin

TurboPower B-Tree Filer and Delphi XE2 - Anyone done it?

感情迁移 提交于 2020-01-05 07:27:11
问题 I might be the last guy on the planet relying on B-Tree Filer but I made the jump from Delphi 2007 to XE2. After getting over all the AnsiChar and PAnsiChar issues, the code now crashes with a Range Check with zero items on a page. Is anyone successfully running B-Tree Filer under Delphi XE2? If so, how'd ya do it? :) Update Range check error here: procedure IsamUnPack(var Page : IsamPage; KeyL : Word); var I, K, S : Word; P : Array [0..0] Of Byte absolute Page; {Real bounds [0..65535]} begin

Indy and smtps: cannot connect

我的未来我决定 提交于 2020-01-04 06:58:05
问题 I am trying to send emails from smtps (secure smtp) using Indy and the technique exaplined in this Marco Cantù article. This is what I am using: object SMTP: TIdSMTP IOHandler = IdSSLIOHandlerSocketOpenSSL1 SASLMechanisms = <> UseTLS = utUseExplicitTLS Left = 32 Top = 196 end and SMTP.Host := 'smtps.pec.aruba.it';; SMTP.Port := 465;; SMTP.Username := 'myaddress@pec.it'; SMTP.Password := 'myPassw0rd'; MailMessage.Encoding := meDefault; MailMessage.From.Address := 'myaddress@pec.it';