Solved

Display Form (TForm) on ISAPI Server with Delphi

Posted on 2007-04-06
11
336 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
  • 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
 

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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now