0

Hello folks,
I have a working CGI written in C. It uses the printf statement to build the outgoing HTML web page. I understand that printf is actually outoutting to the STDOUT device. I'd like to use the WriteFile statement to build the outgoing page and I've tried this:-

WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), &input, byt2wrt, &numwrt, NULL);

and it writes to the console OK when run under the VC++ IDE but fails in the CGI prog. I get Premature end of script headers: gencde.exe, referer: http://... in the Apache logfile.

Can anyone help me on this please?
Ta

2
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by Ancient Dragon
0

my guess is the computer that runs the cgi program does not have .NET framefork installed or the wrong version. Use either fprintf() or cout and you won't have that problem.

0

It has Net 1.1 ? Is this the wrong version. Why does it need this to write to the STDOUT? Not certain I understand this.
Cheers

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.