Article

From:
To:
Alexandre Machado
Subject:
Re: Cannot change thread mode after it is set
Newsgroup:
embarcadero.public.delphi.thirdpartytools.intraweb
URL:
Shortcut to this article
Printer Friendly

Re: Cannot change thread mode after it is set

> {quote:title=Alexandre Machado wrote:}{quote}
> > {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

Alexandre,

I have tried other settings but they did not work - other errors were generated.
I have ADO components in the UserSession for MS SQL for connection to 5 different DBs but the same code base comoiled with 12.2.12 works perfectly.

I will look at the uses sections again.

I think I know the Chee-Yang blog by heart....
Regards
Zane
FYI: Phrase searches are enclosed in either single or double quotes
 
 
 
24-Jul 11:00 utc Operating system upgrade in process, expect some down time.
Originally created by
[Tamarack]
Wed, 26 Sep 2018 09:48:36 UTC
Copyright © 2009-2018
HREF Tools Corp.