1:用OleVariant:
uses ComObj;
...
var
aObj:OleVariant;
begin
aObj := CreateOleObject('Project1.clsOABase');
aObj.Test;
...
end;
2:用TOleServer:
Project|Import Type Library...
把你的VB的引入进来,在组件面板的ActiveX上可以找到它,直接用就行了.
3.用接口.
File|Open...
选择Type Library类型,打开VB的DLL,另存为TLB类型,同时会生成一个同名的PAS,加入到你的工程中,引用到调用的单元.
var
aObj:_clsOABase;
begin
aObj := CoclsOABase.Create;
aObj.Test;
...
end;
uses ComObj;
...
var
aObj:OleVariant;
begin
aObj := CreateOleObject('Project1.clsOABase');
aObj.Test;
...
end;
2:用TOleServer:
Project|Import Type Library...
把你的VB的引入进来,在组件面板的ActiveX上可以找到它,直接用就行了.
3.用接口.
File|Open...
选择Type Library类型,打开VB的DLL,另存为TLB类型,同时会生成一个同名的PAS,加入到你的工程中,引用到调用的单元.
var
aObj:_clsOABase;
begin
aObj := CoclsOABase.Create;
aObj.Test;
...
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货