在Win32中引入了一新变量Variant,可以通过Variant传递数组。具体的实现方法,用Delphi实现为: 
Server(COM/DCOM程序)端: procedure TTestDCOM.Send4(Size: Integer; D1: OleVariant); 
type 
TData=array [0..999] of Byte; 
Var 
  Data:TData; 
  i:Integer; 
begin 
for i:=0 to Size-1 do begin 
  Data[i]:=D1[i]; 
end; 
end; Cleint端: Var 
D1:OleVariant; 
begin 
D1:=VarArrayCreate([0,99],varByte); 

D1[1]:=45; 
.... //将值存入D1中 

S.Send4(99,D1); //S是TestDCOM对象 
end; 

解决方案 »

  1.   

    在Delphi的Project->import type library中导入那个VB写的DLL,可以生成一个~TLB.PAS文件,里面有组件和其接口的声明;将该单元uses到你的单元中,直接调用接口方法就可以了。
      

  2.   

    现在的情况是,
    我的分布式结构:
      客户端----->服务端--->(VB的Dll)--->数据库
    客户端申请得到记录并显示(最后记录集是由DLL产生的ADO.Recordset)。现在我不能很好的控制得到记录由DLL--->服务端--->客户端,也就是说,在这当中都要经过不同的类型转换,
    请哪位大侠指点一二?? 
      感谢。