2011-11-01 92 views
1

让我们承认,我在Delphi Xe2中创建新的包。我一直在名字“我的”。我添加了一个简单的组件“MyComponent”。我编译,我收到C:\ Users \ Public \ Documents \ RAD Studio \ 9.0 \ Bpl \ My.bpl中的文件Bpl。德尔福Xe2包x64

我添加了一个平台“Win x64”。 我编译,我收到C:\ Users \ Public \ Documents \ RAD Studio \ 9.0 \ Bpl \ Win64 \ My.bpl。

... \ Bpl \ Win64 \ My.bpl建立为新包不给,写道“不是windows x32应用程序”。 第一个正常建立,在调色板上组件出现“MyComponent”。 如果要使静音鼠标的索引将出现提示它将被写入的位置,它与x32兼容。 并在本地组件德尔福 - 在所有x32-64兼容。 与磁盘一起Xe2有一个自由磁盘与自由和Tral组件,如果从中例如OverByteIcs或Ip * Works,在他们在所有组件将32-64х兼容性。

问题: 1.如何建立x64的版本包? 2.如何实现,该组件的兼容性是32-64,而不仅仅是32?

P.S.错误的英语语言:ON

回答

5

Delphi IDE是32位,因此只能加载32位设计时包。您当然可以创建64位运行时软件包。

+0

可以举一个简单的创建这样的组件的例子吗? –

+0

正如你所做的一样。添加平台x64,选择x64平台,编译。在设计时您无法将x64目标安装到IDE中。 –

+0

看起来很清楚。即我可以收集,我可以在项目编译时使用这个BPL,但是在IDE中建立我不能? –

3

已经赚了,明白了!

  1. 我们创建空包
  2. 我们添加的组件,例如按钮,它被指定哪个平台进行应用组件(关键时刻是有必要的!

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; 

我们保留,我们在x32下编译。我们添加一个平台x64(在options中应该注册,不同平台下的目录)。 我们在x64下编译。我们收到2个BPL(如第一个问题)。我们建立x32。我们看起来 - 添加了新组件ButtonGu - 32-64兼容。

在这里,我想要的,所有的感谢。 另外http://docwiki.embarcadero.com/RADStudio/en/64-bit_Cross-Platform_Application_Development_for_Windows