help-cgicc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[help-cgicc] Debug / Release Problem


From: Steve . Pole
Subject: [help-cgicc] Debug / Release Problem
Date: Thu, 7 Nov 2002 15:24:14 +0100 (MET)

Well, what I want is to make my CGI application think it is running in a web
server environment, although I have called it from the command line, so I
can step through it and debug it.

So, instead of pointing my browser to
www.someDomain.tld/cgi-bin/scriptName.exe?param01=value01&param02=param02&param03=param03
 I would like to call
scriptName.exe from the command line with whatever form of parameters.

So far I've tried using a batch file (I'm under W2K here...) that looks as
follows:

REM scriptName.bat
@echo off
set QUERY_STRING=param01=value01
scriptName.exe

Your solution also is a working approach, but it unfortunately has the same
problem as mine - it only works for up to one parameter. When I specify more
than one, I'd have to do something like this:

if (argc > 1)
{
   string strQueryString ("QUERY_STRING=");
   
   for (int i = 1; i < argc; i++)
   {
      strQueryString += argv[i];
      strQueryString += " ";
   }
   _putenv (strQueryString.c_str ());
}

and furthermore specify param01=value01 as 'program arguments' in the MSVC
project settings.

When I specify param01=value01 param02=value02 in the project settings (or
do
set QUERY_STRING=param01=value01 param02=value02
in the batch file, everything after 'param01=' is assigned to param01 and
param02 is empty -- apparently no matter what I use as separator. (besides the
space character used above, I tried all kinds of combinations of characters
that came to my mind...

I am actually rather surprised that I seem to be the first one to stumble
into that kind of problem. How is the debugging work done in your applications
?? Do they just run ?? And - come to think of it - how is the cgicc lib
itself debugged ?? 

Maybe someone has an idea...


TIA,

CU S>


> As for debugging your CGI as a stand alone app, I use this little trick
> for debug builds:
>
> #ifndef NDEBUG
>   if(argc>=2){
>     string str("QUERY_STRING=");
>     str+=argv[1];
>     _putenv(str.c_str());
>   }
> #endif
> 
> ans run the app as a console program passing the parms via command line.
> 
> Joaquín M López Muñoz
> Telefónica, Investigación y Desarrollo

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]