Solved

Display Form (TForm) on ISAPI Server with Delphi

Posted on 2007-04-06
11
354 Views
Last Modified: 2013-11-22
I would like to create and display a form (TForm) on my server when specific ISAPI requests are made.  Yes, I know that ISAPI is not intended to be a GUI, but I believe this should be possible.  I can actually get my form to pop up during the ISAPI requests I am watching for, but it comes up frozen.  The server continues working fine, but the form is frozen.  

I simply instantiate a an instance of the form during the paintpageaction.  Can someone suggest a way to make this form come up and not be frozen?

I believe that one workaround might be to spawn a separate delphi app, and pass it windows messages, eg, sendmessage(..), but I would like to avoid this approach if possible.  

Thanks,

Shereif
0
Comment
Question by:SheratonGroup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
11 Comments
 
LVL 21

Expert Comment

by:ziolko
ID: 18865622
of course you realize that ISAPI is multithreaded so what you gonna do show as many forms as threads or access one form by multiple threads?

moreover ISAPI runs is security context of IWAM_COMPUTERNAME user and i guess that's what causing
"frozen" form.

>>I believe that one workaround might be to spawn a separate delphi app
it's not workaround, that's how you should do this.

ziolko.
0
 

Author Comment

by:SheratonGroup
ID: 18877689
I do realize it's multi threaded, and I am fine with multiple forms popping up, in fact that's what I want and indeed what I am seeing now.  

I don't think IWAM_COMPUTERNAME is causing the frozen form, I have given this user Admin priviliges (it's a test box so I am not worried about hacking).  

Any thoughts on how to unfreeze the form?

Shereif  
0
 
LVL 21

Expert Comment

by:ziolko
ID: 18877931
hmmm so maybe this is caused by not processing all nescessary mesages.
but it's just a guess, i never tried GUI with ISAPI.
what exactly you want to see on your form? i'm sure there is better way then putting form explicitly to dll

ziolko.
0
Don't Miss ATEN at InfoComm 2017!

Visit booth #2167 to see the  new ATEN VM3200 32 x 32 Modular Matrix Switch. Other highlights include the VE8950 4K HDMI Over IP Extender, VS1912 12-Port DP Video Wall Media Player  and VK2100 ATEN Control System. Register now with Free Pass Code ATEN288!

 

Author Comment

by:SheratonGroup
ID: 18878197
I want to place DB Components, eg, dbGrids with query information/results, and other information related to the current web request.  

For now simply getting a form with a text box to come up unfrozen would be a great start.

Shereif  

0
 
LVL 21

Expert Comment

by:ziolko
ID: 18878317
write service app that will listen on namedpipe and on ISAPI side simply dump everything to namedpipe.
this way on service side you can do anything you want without changing ISAPI

ziolko.
0
 

Author Comment

by:SheratonGroup
ID: 18882668
Thank you for your suggestions.  As I mentioned I am trying to avoid workarounds that involve interprocess/application communications, eg., using windows messaging or communicating over sockets.

Can anyone think of a way that will get the form to popup but not be frozen?  I think I am pretty close, I currently have the form popup in its own thread.  It gets painted once (for each instance) and then is completely frozen.  During this time the web server works fine.

Shereif
0
 
LVL 21

Accepted Solution

by:
ziolko earned 250 total points
ID: 18882816
well if you want to stick to idea of displaying form within ISAPI i'm no good.

just one more tip about threads in ISAPI:
when first request is called thread is spawned to process request once it's done the thread is waiting for next req. (until ISAPI is not unloaded from IIS), but when there are two simultaneous requests first thread is resumed and second is created, after requests are processed second thread is freed and first one goes into idle state waiting for next req. so basically threads have very "short life".
i know it's not answer to your problem but maybe it will "light some bulb":)


ziolko.
0
 
LVL 26

Assisted Solution

by:EddieShipman
EddieShipman earned 250 total points
ID: 19056937
what I would do is create a separate Delphi applcaition with a MSMQ message listener and when certain messages are being proccessed in my ISAPI applcaition, I would post an MSMQ message to the queue.
This keeps the threading issue aside because you don't have to worry about it if the message is just posted to the queue.

Your Delphi app would read these messages from the queue in a FIFO order and handle them accordingly.
I have seen a couple articles on handling MSMQ messages in Delphi applications.
0
 

Author Comment

by:SheratonGroup
ID: 19059111
That's actually what I have now.  Sending messages is what I am trying to avoid having to do.  

I would like to access the form that has been compiled into the app.  As I've said, it displays, but it comes up frozen.  Note that it doesn't break anything, it's just a frozen form, the rest of the ISAPI app continues working fine.

This may just be impossible, but then again, the fact that it displays at all makes me think that there is a way to make this happen.

thanks for your response,

sse
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 19060095
I do not think ttat can be done because of the way that IIS threads ISAPI applications.
0
 
LVL 21

Expert Comment

by:ziolko
ID: 19653204
is this Q still open?

please see here:
http://www.experts-exchange.com/help.jsp#hs5

ziolko.
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question