我在Dll中定义了两个类和接口,但是为什么我注册的时候只能注册一个呢(100分)

Z

zulu

Unregistered / Unconfirmed
GUEST, unregistred user!
[red][:D]我在Dll中定义了两个类和接口,但是为什么我注册的时候只能注册一个呢,另外一个借口不能调用
如:Gg.ggdll,可以用,但是Gg.tfdll就不能用,这是为什么呢?[/red]
 
没能明白。
 
就是说我在Dll中定义了两个Form但是我只能调用其中一个,我是每一个Form对应一个接口的。
 
你把代码放上来看看,我估计是窗体引用的问题.
 
这是我在Dll中定义的接口,
//钢管刷漆保温
TGgSqDll = class(TAutoObject, IGgSqDll)
private
GgDq,GgDqBs,GgMq,GgMqBs,BwLxS,BwHdS,BhLxS,BhHdS,BhMqLx,BhMqBs:String;
protected
procedure CreateFrmMethod; safecall;
procedure ShowModalMethod; safecall;
function Get_GgDq: WideString; safecall;
function Get_GgMq: WideString; safecall;
procedure Set_GgDq(const Value: WideString); safecall;
procedure Set_GgMq(const Value: WideString); safecall;
function Get_BwLx: WideString; safecall;
procedure Set_BwLx(const Value: WideString); safecall;
function Get_BwHd: WideString; safecall;
procedure Set_BwHd(const Value: WideString); safecall;
function Get_BhLx: WideString; safecall;
procedure Set_BhLx(const Value: WideString); safecall;
function Get_BhHd: WideString; safecall;
procedure Set_BhHd(const Value: WideString); safecall;
function Get_BhMqLx: WideString; safecall;
procedure Set_BhMqLx(const Value: WideString); safecall;
function Get_BHMqBs: WideString; safecall;
procedure Set_BHMqBs(const Value: WideString); safecall;
function Get_GgDqBs: WideString; safecall;
function Get_GgMqBs: WideString; safecall;
procedure Set_GgDqBs(const Value: WideString); safecall;
procedure Set_GgMqBs(const Value: WideString); safecall;
{ Protected declarations }
end;
//通风刷漆保温
TTfSqDll = class(TAutoObject, ITfSqDll)
private
TfDq,TfDqBs,TfMq,TfMqBs,TfBwLx,TfBwHd,TfBhLx,TfBhMqLx,TfBhMqBs,TfXgDq,TfXgDqBs:String;
TfXgMq,TfXgMqBs:String;
protected
procedure CreateFrmMethod; safecall;
procedure ShowModalMethod; safecall;
function Get_DqLx: WideString; safecall;
procedure Set_DqLx(const Value: WideString); safecall;
function Get_DqBs: WideString; safecall;
procedure Set_DqBs(const Value: WideString); safecall;
function Get_MqLx: WideString; safecall;
procedure Set_MqLx(const Value: WideString); safecall;
function Get_MqBs: WideString; safecall;
procedure Set_MqBs(const Value: WideString); safecall;
function Get_BwLx: WideString; safecall;
procedure Set_BwLx(const Value: WideString); safecall;
function Get_BhLx: WideString; safecall;
procedure Set_BhLx(const Value: WideString); safecall;
function Get_BhMqLx: WideString; safecall;
procedure Set_BhMqLx(const Value: WideString); safecall;
function Get_BhMqBs: WideString; safecall;
procedure Set_BhMqBs(const Value: WideString); safecall;
function Get_XgDqLx: WideString; safecall;
procedure Set_XgDqLx(const Value: WideString); safecall;
function Get_XgDqBs: WideString; safecall;
procedure Set_XgDqBs(const Value: WideString); safecall;
function Get_XgMqLx: WideString; safecall;
procedure Set_XgMqLx(const Value: WideString); safecall;
function Get_XgMqBs: WideString; safecall;
procedure Set_XgMqBs(const Value: WideString); safecall;
{ Protected declarations }
end;

这是Form
unit TfsqBw;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, jpeg, ExtCtrls;

type
TTfDlg = class(TForm)
BtnOK: TBitBtn;
BtnCancel: TBitBtn;
BtnHelp: TBitBtn;
GroupBox1: TGroupBox;
Label12: TLabel;
Label11: TLabel;
Label6: TLabel;
Label5: TLabel;
Label4: TLabel;
Label3: TLabel;
Label2: TLabel;
Label1: TLabel;
GBDQ: TComboBox;
GBDQBS: TComboBox;
GBMQ: TComboBox;
GBMQBS: TComboBox;
BWC: TComboBox;
BWCHD: TComboBox;
XGMQ: TComboBox;
XGMQBS: TComboBox;
Label13: TLabel;
BhLx: TComboBox;
Panel1: TPanel;
Label7: TLabel;
BWCMQ: TComboBox;
BWCMQBS: TComboBox;
Label8: TLabel;
Label10: TLabel;
XGDQBS: TComboBox;
Label9: TLabel;
XGDQ: TComboBox;
Image1: TImage;
private
{ Private declarations }
public
Function CreateFrm:Boolean;
end;

var
TfDlg: TTfDlg;

implementation

{$R *.DFM}

Function TTfDlg.CreateFrm:Boolean;
begin
TfDlg:=TTfDlg.Create(Application);
TfDlg.Caption:='通风刷漆保温';
end;

end.
-----------------------------------------------------
这个Form可以注册:
unit GgSyBw;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, ExtCtrls;

type
TGgDlg = class(TForm)
Panel1: TPanel;
GroupBox1: TGroupBox;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
Label1: TLabel;
DqLx: TComboBox;
Label2: TLabel;
DqBs: TComboBox;
MqLx: TComboBox;
Label3: TLabel;
MqBs: TComboBox;
Label4: TLabel;
Label6: TLabel;
BwMqLx: TComboBox;
Label7: TLabel;
BwMqBs: TComboBox;
Label8: TLabel;
Label9: TLabel;
BhLx: TComboBox;
BhHd: TComboBox;
Label5: TLabel;
BwHd: TEdit;
BwLx: TComboBox;
Image1: TImage;
procedure BhLxChange(Sender: TObject);
procedure BwMqLxChange(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
Function CreateFrm:Boolean;
end;

var
GgDlg: TGgDlg;

implementation

{$R *.DFM}

Function TGgDlg.CreateFrm:Boolean;
begin
GgDlg:=TGgDlg.Create(Application);
GgDlg.Caption:='管道刷漆保温';
end;

procedure TGgDlg.BhLxChange(Sender: TObject);
var
BhLxNoHd,Hd1,Hd2,Hd3,Hd4:String;
begin
BhLxNoHd:='包铅丝网保护层,缠铝箱保护层,包玻璃钢壳保护层,包金属皮保护层,缠玻璃丝布,缠防火塑料布';
Hd1:='麻刀白灰保护层,麻刀水泥石棉灰保护层';
Hd2:='聚苯乙烯泡沫塑料板,聚氨脂泡沫塑料板';
Hd3:='岩棉板,铝箔岩棉板';
Hd4:='聚氨脂泡沫塑料防结露,复合聚乙烯泡沫塑料防结露';
if pos(BhLx.Text,Hd1)>0 then begin
BhHd.Items.Clear;
BhHd.Items.Add('10');
BhHd.Items.Add('15');
BhHd.Items.Add('20');
end
else if Pos(BhLx.Text,BhLxNoHd)>0 then
BhHd.Clear
else if pos(BhLx.text,Hd2)>0 then begin
BhHd.Items.Clear;
BhHd.Items.Add('25');
BhHd.Items.Add('40');
BhHd.Items.Add('50');
end
else if BhLx.Text='玻璃棉板' then begin
BhHd.Clear;
BhHd.Items.Add('30');
end
else if BhLx.Text='玻璃棉管壳' then begin
BhHd.Clear;
BhHd.Items.Add('40');
end
else if pos(BhLx.Text,Hd3)>0 then begin
BhHd.Clear;
BhHd.Items.Add('30');
BhHd.Items.Add('50');
end
else if BhLx.Text='橡塑保温板' then begin
BhHd.Clear;
BhHd.Items.Add('10');
BhHd.Items.Add('20');
end
else if pos(BhLx.Text,Hd4)>0 then begin
BhHd.Clear;
BhHd.Items.Add('5');
BhHd.Items.Add('10');
BhHd.Items.Add('20');
end;
end;

procedure TGgDlg.BwMqLxChange(Sender: TObject);
begin
if pos('布面',BwMqLx.Text)>0 then
BhHd.Text:='';
end;

procedure TGgDlg.FormShow(Sender: TObject);
begin
BhLxChange(nil);
end;
procedure TGgDlg.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=caFree;
end;

end.
 
接受答案了.
 
顶部