Recent

Author Topic: Assign a Synapse Document to TMemoryStream  (Read 1758 times)

kapibara

  • Hero Member
  • *****
  • Posts: 610
Assign a Synapse Document to TMemoryStream
« on: January 19, 2015, 04:50:46 am »
An app makes a request for a HTML page using THTTPSend. The result ends up in HTTPSend.Document.

Code: [Select]
if SynaHttp.HTTPMethod('GET',Target) then SynaHttp.Document.SaveToStream(AMemoryStream);
Instead of SaveToStream, is possible to just assign the memory address of HttpSend.Document to AMemoryStream? And stop HttpSend from clearing the content of Document? Because otherwise I suppose that when HTTPSend is destroyed, it will free the content of its Document and there goes the data that AMemoryStream points to.. ::)
Lazarus trunk / fpc 3.2.2 / Kubuntu 22.04 - 64 bit

 

TinyPortal © 2005-2018