Is there a version of Async Pro which works with Delphi XE3?

╄→尐↘猪︶ㄣ 提交于 2019-12-13 07:35:45

问题


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.

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

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;

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;

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.

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.


回答1:


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.




回答2:


Acording to this blog post:

http://blog.kassebaum.eu/?p=379

Async Proffesional is currently maintained by Roman Kassebaum but only for latest versions of RAD studio (both Delphi and CBuilder).

The menioned blog links to next source forge page: http://sourceforge.net/projects/turbopowerasyncprofessionalnew/?source=navbar

Infromation on the page indicates that the project is closed and that it moved to github but no link is provided.

After doing some searching on GitHub I found the projects page

https://github.com/TurboPack/AsyncPro

Anyway since Roman Kassebaum is maintaing the project to be compatible with newest Delphi version it might not work for you.

So I strongly recomend you get in contact with Roman Kassebaum as he will best know which version should you use with your Delphi XE3 instalation or what needs to be fixed to make it compatible.




回答3:


The official AsyncPro version moved to GitHub. You can find it under TurboPack. It supports the latest Delphi and C++Builder version.

I also created a branch for XE3. You can find it under TurboPack XE3.



来源:https://stackoverflow.com/questions/29455378/is-there-a-version-of-async-pro-which-works-with-delphi-xe3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!