Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XmlHttpRequest and threads in Delphi

I use Delphi 2010 and when I try to perform an XmlHttpRequest operation inside a separate thread from my application, I get an EOleSysError exception with the following message: 'CoInitialize has not been called, ClassID: {F6D90F16-9C73-11D3-B32E-00C04F990BB4}'

Anyone have any ideas to fix this? (Sorry for my bad English)

Thanks!

like image 995
Ariel Rivas Avatar asked Jun 16 '11 00:06

Ariel Rivas


1 Answers

Call CoInitialize at the beginning of your thread's Execute method. Don't forget to call CoUninitialize at the end of Execute.

Chris Bensen wrote some blog posts about this.

like image 127
Bruce McGee Avatar answered Nov 11 '22 09:11

Bruce McGee