是否有与Delphi XE3兼容的Async Pro版本? [英] Is there a version of Async Pro which works with Delphi XE3?

查看:95
本文介绍了是否有与Delphi XE3兼容的Async Pro版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Delphi XE3中使用 Async Pro .我在SourceForge上找到了A407版本,这似乎是最新版本.当我尝试安装运行时软件包A407_R100.bpl时,出现错误,即数据长度超过2GB.当我解决此问题(有一些猜测)时,出现了另外4个错误.我也可以尝试修复这些问题,但恐怕我将不得不修补太多代码,以致其不再起作用.

I want to use Async Pro in my Delphi XE3. I found a version A407 on SourceForge, which seems to be the latest. When I try to install the runtime package A407_R100.bpl I get an error that a data length is longer than 2GB. When I fix this (with some guesswork) I get 4 other errors. I can try to fix those as well, but I'm afraid I will have to patch so much of the code that it won't work anymore.

是否存在与XE3兼容的 Async Pro 版本?还是至少有明确且经过验证的说明如何对代码进行修补?

Is there a version of Async Pro which works with XE3? Or at least clear and proven instructions how to patch the code?

更新
在这里我找到了一个 AsyncPro 库,该库似乎是最新的-日期;至少这些软件包的名称是A407_ * 140.bpl,而不是A407_ * 100.bpl.我在 AwAbsPd.pas 中的代码的这一部分仍然存在一些错误:

update
Here I found an AsyncPro library which seems to be more up-to-date; at least the packages are named A407_*140.bpl instead of A407_*100.bpl. I still had a couple of errors in this part of the code in AwAbsPd.pas:

procedure InitializeUnit;
var
  TmpDateSeparator : char;
  TmpDateFormat : string[15];
  TmpDateTime : TDateTime;
begin
  {Set Unix days base}
  TmpDateFormat := ShortDateFormat;
  TmpDateSeparator := DateSeparator;
  DateSeparator := '/';
  ShortDateFormat := 'mm/dd/yyyy';
  TmpDateTime := StrToDateTime('01/01/1970');
  UnixDaysBase := Trunc(TmpDateTime);
  DateSeparator := TmpDateSeparator;
  ShortDateFormat := TmpDateFormat;

尽管 SysUtils 在"uses"子句中,但我得到未定义ShortDateFormatDateSeparator的错误.因此,我对它们进行了硬编码:

Although SysUtils is in the "uses" clause I got errors that ShortDateFormat and DateSeparator weren't defined. So I hard-coded them:

procedure InitializeUnit;
var
  TmpDateSeparator : char;
  TmpDateFormat : string[15];
  TmpDateTime : TDateTime;

// added stevenvh
var
  DateSeparator: char;
  ShortDateFormat: String;
  ShortTimeFormat: String;
// end addition

begin
  // added stevenvh
  DateSeparator := '-';
  ShortDateFormat := 'yyyy-mm-dd';
  ShortTimeFormat := 'HH:mm:ss';
  // end addition

  {Set Unix days base}
  TmpDateFormat := ShortDateFormat;
  TmpDateSeparator := DateSeparator;
  DateSeparator := '/';
  ShortDateFormat := 'mm/dd/yyyy';
  TmpDateTime := StrToDateTime('01/01/1970');
  UnixDaysBase := Trunc(TmpDateTime);
  DateSeparator := TmpDateSeparator;
  ShortDateFormat := TmpDateFormat;

就在附近!运行时和designtime软件包都可以编译,但是当我尝试安装designtime软件包时,出现错误消息"01/01/1970"不是有效日期.这不是上面代码中的错误,因为当我更改代码中的日期时,它仍然是相同的"01/01/1970".

Nearly there! Both runtime and designtime packages compile, but when I try to install the designtime package I get an error that "01/01/1970" is not a valid date. This is not an error in the above code, because it remains the same "01/01/1970" when I change the date in the code.

原来只有1个其他文件,其中包括"01/01/1970"作为文本,但这是一个.ocx文件,因此我不确定如何或什至应对此打补丁.

Turns out there is only 1 other file which includes "01/01/1970" as text, but this is a .ocx file, so I'm not sure how or even if I should patch this.

推荐答案

使用FormatSettings.ShortDateFormatFormatSettings.DateSeparator,...,而不是引入您自己的变量.那将是最接近原始的.

Use FormatSettings.ShortDateFormat, FormatSettings.DateSeparator, ... instead of introducing your own variables. That would be closest to the original.

一种更干净的方法是将日期/时间函数与格式设置重载一起使用,而不是临时更改全局格式设置.

A cleaner approach would be using the date/time functions with a formatsettings overload instead of temporarily changing the global formatsettings.

这篇关于是否有与Delphi XE3兼容的Async Pro版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆