调用 返回数值的
调用 返回字符的
调用 返回指针的

解决方案 »

  1.   

    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;