title: TThread and COM - "CoInitialize has not been called", although CoInitialize is called in the constructor
body: <p>I'm trying to use COM interface within a thread. From what I have read I have to call <code>CoInitialize/CoUninitialize</code> in each thread.</p>
  
  <p>While this is working fine:</p>
  
  <pre><code>procedure TThreadedJob.Execute;
  begin
     CoInitialize(nil);
  
     // some COM stuff
  
     CoUninitialize;
  end;
  </code></pre>
  
  <p>when I move the calls to constructor and destructor:</p>
  
  <pre><code>TThreadedJob = class(TThread)
  ...
    protected
      procedure Execute; override;
    public
      constructor Create;
      destructor Destroy; override;
  ...
  
  constructor TThreadedJob.Create;
  begin
    inherited Create(True);
    CoInitialize(nil);
  end;
  
  destructor TThreadedJob.Destroy;
  begin
    CoUninitialize;
    inherited;
  end;
  
  procedure TThreadedJob.Execute;
  begin
  
     // some COM stuff
  
  end;
  </code></pre>
  
  <p>I get <strong>EOleException: CoInitialize has not been called</strong> exception and I have no clue why.</p>