views:

664

answers:

4

I have a Windows CGI created with Delphi 2007 using CGIExpert that I need to debug.

Is there any simply way to run it from within the IDE while passing parameters to it? I tried setting the Host Application to iexplore.exe (Run|Parameters) and entering some text on the Parameters field but it just can't seem to pass any parameters at runtime.

Anyone knows of a way so that I can run the cgi with some parameters from within Delphi IDE?

A: 

This is not answering your question but might be helpful:

http://www.htmlhelp.org/tools/cg-eye/live.html

you pass the URL of your CGI and it sends values to it to detect problems.

Vinko Vrsalovic
A: 

You need a webserver for that. Once you loaded it into the webserver you can attach the Delphi debugger to it. Not exactly F9 and debug, but it works.

If you have build the CGI using Delphi's web-broker stuff you can also choose to make a Webapp Debugger which uses a small webserver for debug purpeses only. If you model your application right you can use the same code in both a real production CGI and a webapp debuger version to get the best of both worlds. See http://articles.techrepublic.com.com/5100-10878_11-1050539.html

Lars Truijens
This CGI was created using CGI Expert. I have IIS installed and setup to run this cgi. How can I attach the Delphi debugger to it?
smartins
Run - Attach Process and choose IIS
Lars Truijens
+1  A: 

If you have newer versions of Delphi it comes with a built-in WebApp Debugger just for this purpose. If you have an older version of Delphi, try CGIExpert which was the best way to use CGI in Delphi.

Darian Miller
+2  A: 

Something I have used to debug ISAPI based applications is idDebugger. While I haven't specifically tried it with a CGI application, it might be worth a look. The author specifically mentions the fact that it assists with CGI applications. The nice thing about this solution is that it makes debugging an ISAPI (and I suspect a CGI application) as easy as debugging a windows form based application...just set a few breakpoints and debug away.

To use it, just set the working directory to the directory where your CGI/ISAPI executable is located, and set the host application to the idDebugger.exe file. Then set the parameters to the URL line (minus the http://localhost/) and your all set.

skamradt
Thanks, that did it! Btw, is there any way of automatically fill up the root folder and url values on idDebugger? The way I was able to get it to work was run the cgi from Delphi, then start idDebugger and fill out the root and folder url values and finally click execute.
smartins
if I remember correctly, you set the working directory to your root folder, and then set your url values as the parameters in your project options | debugger form.
skamradt
if the above doesn't work, then create a shortcut to the idDebugger and modify it to pass the appropriate parameters...I know that works.
skamradt