Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Display Form (TForm) on ISAPI Server with Delphi

Posted on 2007-04-06
11
Medium Priority
?
359 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
Turn your laptop into a mobile console!

The CV211 Laptop USB Console Adapter provides a direct Laptop-to-Computer connection for fast and easy remote desktop access with no software to install.

 

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 1000 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 1000 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

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…
What You Need to Know when Searching for a Webhost Provider
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

704 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