这是以前大侠教我了
告诉你一个万能方法:
把你的数据变成流,把流变成VARIANT,用VARIANT传递,收到后再倒着变回来,
就什么都可以传了
祝你好运
function StreamToVariant(Stream: TStream): OleVariant;
var
p: Pointer;
begin
Result := VarArrayCreate([0, Stream.Size - 1], varByte);
p := VarArrayLock(Result);
try
Stream.Position := 0;
Stream.Read(p^, Stream.Size);
finally
VarArrayUnlock(Result);
end;
end;
function VariantToStream(const Data: OleVariant ):TStream;
var
p: Pointer;
Stream: TStream;
begin
p := VarArrayLock(Data);
try
Stream.Write(p^, VarArrayHighBound(Data,1) + 1);
finally
VarArrayUnlock(Data);
end;
Result:=Stream;
end;