Display Form (TForm) on ISAPI Server with Delphi

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
SheratonGroupAsked:
Who is Participating?
 
ziolkoConnect With a Mentor Commented:
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
 
ziolkoCommented:
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
 
SheratonGroupAuthor Commented:
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
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
ziolkoCommented:
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
 
SheratonGroupAuthor Commented:
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
 
ziolkoCommented:
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
 
SheratonGroupAuthor Commented:
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
 
Eddie ShipmanConnect With a Mentor All-around developerCommented:
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
 
SheratonGroupAuthor Commented:
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
 
Eddie ShipmanAll-around developerCommented:
I do not think ttat can be done because of the way that IIS threads ISAPI applications.
0
 
ziolkoCommented:
is this Q still open?

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

ziolko.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.