From: "Johan Venter" Newsgroups: comp.os.msdos.djgpp References: <38010A1D DOT BCF60B35 AT null DOT videotron DOT ca> Subject: Re: Question regarding CGI Lines: 51 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Message-ID: Date: Mon, 11 Oct 1999 11:00:21 +1000 NNTP-Posting-Host: 203.40.83.91 X-Trace: newsfeeds.bigpond.com 939642854 203.40.83.91 (Mon, 11 Oct 1999 21:54:14 EST) NNTP-Posting-Date: Mon, 11 Oct 1999 21:54:14 EST Organization: Telstra BigPond Internet Services (http://www.bigpond.com) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com bub wrote in message news:38010A1D DOT BCF60B35 AT null DOT videotron DOT ca... > Hi all, > > Been using djgpp for a little while now on windows nt. > Today I decided to try to write a CGI application to use via > Windows NT's Peer web service's web server. The code ( fairly > simplistic, included below ). I get an error when I try to run > it, claiming that the application didn't return the proper http > headers, it then includes nothing as the error. > I compiled the same code under Visual C++ on my work PC, and > it runs fine... what gives ? Can Windows NT's web server run DOS executables? The code below should work fine. I write all my CGI's in DJGPP and they run perfectly on various servers. > I couldn't find any references to CGI or problems related to it > in the DJGPP FAQ. It's not really something that's part of DJGPP. The CGI interface is so simple, there is not much place for error if your program is printing to stdout, unless of course you're server doesn't like the executable. > /*----------- foo.c -------------------- > cgi app that prints blah blah in red > */ > > #include > > int > main(int argc, char **argv) > { > fprintf(stdout,"Content-Type: text/html\n\n"); > fprintf(stdout," \n" > "

Blah blah blah

\n" > " "); > > return 0; > } Very strange indeed. It should work. Have you tried just plain printf (not that that makes make difference)?. Maybe this is just a case of an egotistical Microsoft product not wanting to run a DOS executable. -- Johan Venter ICQ 3643877 - jventer AT writeme DOT com The TPU DJGPP Interest Group - http://surf.to/djgppig The RSXNTDJ 1.5 HOWTO - http://surf.to/rsxntdj