Mega Search
23.2 Million


Sign Up

Make a donation  
Cannot change thread mode after it is set  
News Group: embarcadero.public.delphi.thirdpartytools.intraweb

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

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 11-Feb-2013, at 11:24 PM EST
From: Zane Leo
 
Re: IW12.2.11 Update dataset on parent form  
News Group: embarcadero.public.delphi.thirdpartytools.intraweb
I use such trick:
1. In the form of TIWForm1 I declare public property NeedRefresh which can be used so:

{code}
procedure TIWForm1.IWAppFormRender (Sender: TObject);
begin
  if FNeedRefresh and Grid.DataSource.DataSet.Active then
  begin
    try
      RefreshData;
.....
    except
      on E: Exception do
        WebApplication.ShowMessage (E.Message);
    end;
end;
{code}

2. In the form of TIWForm2 after successful modification of a database and before a call of Release I insert

{code}
      if Self.Owner is TIWForm1 then
        TIWForm1 (Self.Owner).NeedRefresh: = True;
{code}
It works fine for me!

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 16-Nov-2012, at 12:56 AM EST
From: Igor Repnikov
 
Re: IW12.2.11 Update dataset on parent form  
News Group: embarcadero.public.delphi.thirdpartytools.intraweb
Pedro,

Thanks, that works fine. 

regards

Bill Zwirs

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 19-Nov-2012, at 7:05 PM EST
From: Bill Zwirs