title: How can I initialize my custom IdIOHandler fields?
body: <p>This is blowing my mind... I just want to make a new <code>IdIOHandler</code>, and, as usual, I need to do some initialization in the constructor... Normally, I override the constructor of the base class, but this <code>TIdIOHandlerStack</code> which I inherit from, is far from &quot;normal&quot; ! It has no constructor to override, and is not known (to me) how it is created.</p>
  <pre><code>  TIdEnhancedIOHandler = class(TIdIOHandlerStack)
    private
      FSendBuffer: TIdBytes;
      FSendBuff: TDataStream;
    public
      constructor Create;  // &lt;-- I tested all the variations here, but non of them work
      destructor  Destroy; override;
    end;
  
    implementation
  
    constructor TIdEnhancedIOHandler.Create;
    begin
     inherited Create;
     FSendBuff:= TDataStream.Create(@SendBuffer);
    end;
  
    destructor TIdEnhancedIOHandler.Destroy;
    begin
     FSendBuff.Free;
     inherited;
    end;
  
    initialization
  
      TIdEnhancedIOHandler.SetDefaultClass;
  </code></pre>
  <p>Where should I put my intitialization code so that it is executed when a new instance of <code>TIdEnhancedIOHandler</code> is created BY DEFAULT in all Indy Components which use IOHandlers ?</p>