These might help
function OleVariantToMemoryStream(OV: OleVariant) : TMemoryStream;
var
  Data: PByteArray;
  Size: integer;
begin
  Result := TMemoryStream.Create;
  try
    Size := VarArrayHighBound (OV, 1) - VarArrayLowBound(OV, 1) + 1;
    Data := VarArrayLock(OV);
    try
      Result.Position := 0;
      Result.WriteBuffer(Data^, Size);
    finally
      VarArrayUnlock(OV);
    end;
  except
    Result.Free;
    Result := nil;
  end;
end;

function MemoryStreamToOleVariant(Strm: TMemoryStream):OleVariant;
var
   Data: PByteArray;
begin
  Result := VarArrayCreate ([0, Strm.Size - 1], varByte);
  Data := VarArrayLock(Result);
  try
    Strm.Position := 0;
    Strm.ReadBuffer(Data^, Strm.Size);
  finally
    VarArrayUnlock(Result);
  end;
end;


Paul Mckenzie wrote:


I have a DCOM AppServer with a BMP I want to send to the Client.
How do I send a BMP to I client - I can't seem to figure this out
Ok - I can try converting it to a VariantByte array and sending a OLEVariant
There must be a better way - I can't see how to use OLEStreams.
Any help appreciated.
Regards
Paul McKenzie
Analyst Programmer
SMSS Ltd.



------------------------------------------------------------------------


_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi


--
Alister Christie
Computers for People
Phone: 04 471 1849 / Fax: 04 471 1266
PO Box 13085
Johnsonville
Wellington


_______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to