Delphi Xe2 Package x64

2019-08-13 16:36发布

问题:

Let's admit, I create new package in Delphi Xe2. I keep under a name "My". I add a simple component "MyComponent". I compile, I receive file Bpl in C:\Users\Public\Documents\RAD Studio\9.0\Bpl\My.bpl.

I add a platform "Win x64". I compile, I receive C:\Users\Public\Documents\RAD Studio\9.0\Bpl\Win64\My.bpl.

...\Bpl\Win64\My.bpl to establish as new package does not give, writes "is not windows x32 applications". The first is established normally and on a palette the component appears "MyComponent". If to bring to are mute the index of a mouse will appear hint where it will be written, that it x32-compatible. And at native component Delphi - at all x32-64 compatible. Together with a disk to Xe2 there is a free disk with Free and Tral components if to put therefrom for example OverByteIcs or Ip*Works, that at them at all components will be 32-64х compatibility.

Questions: 1. How to establish the x64 the version package? 2. How to achieve, that the component had a compatibility 32-64, and not just 32?

P.S. Bad English language: ON

回答1:

The Delphi IDE is 32 bit and so can only load 32 bit designtime packages. You can of course create 64 bit runtime packages.



回答2:

Has earned, has understood!

  1. We create empty package
  2. We add the component, for example Button and it is specified what platforms for a component (the key moment are necessary!)

Example

unit GuButton;

interface

uses
  System. SysUtils, System. Classes, Vcl. Controls, Vcl. StdCtrls;

type
  [ComponentPlatformsAttribute (pidWin32 or pidWin64)] // !!!!!!!!!!!!!!!
  TButtonGu = class (TButton)
  private
    {Private declarations}
  protected
    {Protected declarations}
  public
    {Public declarations}
  published
    {Published declarations}
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents (' Gu ', [TButtonGu]);
end;

We keep, we compile under x32. We add a platform x64 (in options should be registered, that directories under platforms different). We compile under x64. We receive 2 BPL (as in the first question). We establish x32. We look - new component ButtonGu - 32-64 compatible was added.

Here I that wanted, all thanks. In addition http://docwiki.embarcadero.com/RADStudio/en/64-bit_Cross-Platform_Application_Development_for_Windows