CGI32.BASmodule that ships with WebSite, and which provides all of the interface code needed to get the CGI environment set up in VB globals. This module contains the
Sub Mainprocedure. When
Sub Mainis finished with the CGI interface tasks, it calls the application via
Sub CGI_Main, which is in the separate VB module that contains the code for the sample application. The application returns to
Sub Mainwhen it is finished.
CGI32.BAS also contains a global exception handler that will
catch all VB runtime exceptions, including user-defined errors. If
an exception occurs, the exception handler in
rewinds the output file and inserts a fully formatted HTTP
500 Server Error response. Within the body of this response,
the exception handler puts the textual VB runtime error message. The
server then (transparently) returns this HTTP error message to the
browser, allowing the user to see exactly what happened.
Finally, note that WebSite fully decodes all form fields before starting the Windows CGI program.