delphi 引用方式:
Project->Import Type Library ->
可以看到 MyQoo Library (Version 1.0)名称
->Create Unit ->在Borland\import资料夹产生MyQoo_TLB.pas单元給其他程式引用
应用范列:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses MyQoo_TLB;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
q:TQoo;
begin
q:=TQoo.Create(nil);
ShowMessage(q.MdacVer); //显示MDAC版本
q.Free;
end;
end.
ActiveX Library在Delphi中制作方式:
1、File -> New -> Other -> ActiveX -> ActiveX Library-->建立储存MyQOO.dpr专案
2、File -> New -> Other -> ActiveX -> Com Object,填写Class Name (名称Qoo)->储存专案
3、Project-->选择Type library视窗(MyQoo.tlb标题视窗)。
4. 在IQoo开始新增方法,点选Registry Type library注册,即可在Unit1.pas单元中产生相对应的方法。
5进行编译,Project->Complie/Build-> 建议MyQoo.DLL档