Article

From:
To:
Zane Leo
Subject:
Re: Cannot change thread mode after it is set
Newsgroup:
embarcadero.public.delphi.thirdpartytools.intraweb

Re: Cannot change thread mode after it is set

> {quote:title=Zane Leo wrote:}{quote}
> Delphi XE - IW Ultimate 12.2.13.2
> 
> ISAPI App working perfectly compiled with IW 12.2.12;
> 
> Rebuilt ISAPI app with IW 12.2.13.2:
> 
> On my dev Win 7 / IIS 7.5 the ISAPI app works fine
> 
> On a deploy Win 2008 Server / IIS 7.0 when a user attempts to connect to the ISAPI app generated the following error:
> "Error message raised by the application: Cannot change thread mode after it is set"
> 
> I created a stand alone version of the app and it works fine on the same Win 2008 Server.
> 
> Been "bugging" me for days. Any suggestions?
> 
> For ISAPI ComInitialization  is set to ciMultiThreaded and nowhere in the code is it changed...
> 
> TIA
> 
> Zane

Hi Zane,

I've created a new ISAPI IW application, set ComInitialization to ciMultiThreaded and deployed it in Win 2008 R2.

Everything works as expected and the application is working perfectly.

Did you try to set ComInitialization to something else and see what you get?
Do you use some 3rd party libraries also using COM? Subsequent calls to CoInitialize or CoInitializeEx may trigger that error...

Also, are you sure that your IIS setup is correct? A nice how-to can be found here: http://chee-yang.blogspot.co.nz/2009/10/configure-windows-7-iis7-for-isapi-dll.html

Best regards
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Thu, 28 Mar 2024 18:33:04 UTC
Copyright © 2009-2024
HREF Tools Corp.