Creating a stream...

im using TNMUUProcessor component that ships with delphi 5.

is it posible to create a stream between 2 TMemo to endcode/decode the data trough TNMUUProcessor... I only know how to setup a TFileStream (see examle in DEMO dir), but i want te encode/decode in the memory...

plz help

Comments

  • : im using TNMUUProcessor component that ships with delphi 5.
    :
    : is it posible to create a stream between 2 TMemo to endcode/decode the data trough TNMUUProcessor... I only know how to setup a TFileStream (see examle in DEMO dir), but i want te encode/decode in the memory...
    :
    : plz help
    :
    The TMemoryStream works the same way as the TFileStream, except that it keeps its data in the memory and not on disk.
  • Hi, but how can i open a stream with my Memo?!

    : : im using TNMUUProcessor component that ships with delphi 5.
    : :
    : : is it posible to create a stream between 2 TMemo to endcode/decode the data trough TNMUUProcessor... I only know how to setup a TFileStream (see examle in DEMO dir), but i want te encode/decode in the memory...
    : :
    : : plz help
    : :
    : The TMemoryStream works the same way as the TFileStream, except that it keeps its data in the memory and not on disk.
    :

  • : Hi, but how can i open a stream with my Memo?!

    You can make the memo to read it's data from a stream with this:

    [code]
    Memo1.Lines.LoadFromStream(...);
    [/code]

    to write the memo's data to a stream, you can use this:

    [code]
    Memo1.Lines.SaveToStream(...);
    [/code]

    tron.
  • im getting an error on this code:

    [code]

    Memo1.Lines.SaveToStream(NMUUE1.InputStream);

    ERROR > Memo2.Lines.LoadFromStream(NMUUE1.OutputStream);

    [/code]

    NMUUE1 component can be found on the fastnet page (delphi 5)

    : : Hi, but how can i open a stream with my Memo?!
    :
    : You can make the memo to read it's data from a stream with this:
    :
    : [code]
    : Memo1.Lines.LoadFromStream(...);
    : [/code]
    :
    : to write the memo's data to a stream, you can use this:
    :
    : [code]
    : Memo1.Lines.SaveToStream(...);
    : [/code]
    :
    : tron.
    :

  • Hi NecroDOME. I think you're using outputstream incorrectly. It is a property that points to a stream, not an ACTUAL stream. According to the OLH you have to set the outputstream, prior to calling Encode/Decode.

    Try creating a temporary TMemoryStream.
    Assign it to output stream.
    Call Decode (Encode).
    Set the MemoryStream.Position to 0 (zero).
    Call Memo.Lines.LoadFromStream(MemoryStream).

    The above is untested, but as far as I've read correct.

    hth, pritaeas
    (groetjes uit Roermond)

    : im getting an error on this code:
    :
    : [code]
    :
    : Memo1.Lines.SaveToStream(NMUUE1.InputStream);
    :
    : ERROR > Memo2.Lines.LoadFromStream(NMUUE1.OutputStream);
    :
    : [/code]
    :
    : NMUUE1 component can be found on the fastnet page (delphi 5)


  • Hi pritaeas,

    It worked, thanx again!

    (Groetes uit Weert)

    : Hi NecroDOME. I think you're using outputstream incorrectly. It is a property that points to a stream, not an ACTUAL stream. According to the OLH you have to set the outputstream, prior to calling Encode/Decode.
    :
    : Try creating a temporary TMemoryStream.
    : Assign it to output stream.
    : Call Decode (Encode).
    : Set the MemoryStream.Position to 0 (zero).
    : Call Memo.Lines.LoadFromStream(MemoryStream).
    :
    : The above is untested, but as far as I've read correct.
    :
    : hth, pritaeas
    : (groetjes uit Roermond)
    :
    : : im getting an error on this code:
    : :
    : : [code]
    : :
    : : Memo1.Lines.SaveToStream(NMUUE1.InputStream);
    : :
    : : ERROR > Memo2.Lines.LoadFromStream(NMUUE1.OutputStream);
    : :
    : : [/code]
    : :
    : : NMUUE1 component can be found on the fastnet page (delphi 5)
    :
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories