Re: Problems recompiling Indy

Giganews Newsgroups
Subject: Re: Problems recompiling Indy
Posted by:  Remy Lebeau (TeamB) (
Date: Thu, 19 Jan 2006

"Ciaran Costelloe" <ccostell…> wrote in message

> IdGlobal's WriteStringToStream gives a warning that LBytes
> might not have been initialised, which looks like it might be valid.

What does your copy of WriteStringToStream() look like?  Mine looks like

    procedure WriteStringToStream(AStream: TIdStream; const AStr :string);
        LBytes: TIdBytes;
        if AStr = '' then Exit;
        LBytes := ToBytes(AStr); // <-- always initialized!!
        TIdStreamHelper.Write(AStream, LBytes);

> Due to (good) rewrites in Indy, IdCoderTNEF won't compile because
> of TIdStreamVCL.

That's ok.  I always meant to eventually post my own TNEF implementation
anyway ;-)

Seriously, though, not every component in Indy has been updated yet to not
use TIdStreamVCL anymore - and TIdStreamVCL was removed from Indy 10 a long
time ago.

> Changing those declarations from TIdStreamVCL to TStream allows it to

Do not use TStream directly.  Always use TIdStream instead, which maps to
the proper platform-specific Stream class (Tstream for the Win32 VCL).

> but gives warnings of "Constructing instance of 'TStream' containing
abstract method
> 'TStream.Read'" and the same for 'TStream.Write'.

You cannot instantiate TStream directly, for exactly the reason you have
seen - it is an abstract base class.  You must always use a descendant class



In response to

Problems recompiling Indy posted by Ciaran Costelloe on Wed, 18 Jan 2006