Solved

Display Form (TForm) on ISAPI Server with Delphi

Posted on 2007-04-06
11
353 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
exchange 2010 turning off 3des ciphers 2 434
WebSite Direction 1 62
Twebbrowser in Fire monkey android scrolling to bottom 1 67
Delphi Seattle StructureView color 1 21
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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

735 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