View Single Post
  #6  
Old 10-21-2016, 12:05 PM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,335
Default

And that's the only code in this thread?
What might be an issue is that you call this code from another part where you also did CoInitialize...

Then you could get a construction like:
Code:
  CoInitialize(nil);
  try
    ... do some things
    DoSomething();
    ... do some more things
  finally
    CoUninitialize();
  end;

procedure DoSomething();
begin
  CoInitialize(nil);
  try
    // bla...
  finally
    CoUnitialize();
  end;
end;
If you reach the "... do some more things" you've called CoInitialize(nil) twice, called CoUnitialize (which has no clue of what to unitialize so all will be done).
And I'm not sure what calling CoInitialize(nil) twice has for an effect???

But again, another longshot...