This has nothing to do with Chilkat, but I thought it might be of interest to others.
This example demonstrates how to run a .exe from an ASP script, and pipe the output back to ASP.
Here’s the ASP script:
<html>
<body bgcolor="#FFFFFF">
<p>
<%
dim Shell
set Shell = CreateObject("wscript.shell")
Dim Pipe
set Pipe = Shell.Exec(Server.MapPath("/cgi-bin/HelloWorld.exe"))
do while(not Pipe.StdOut.AtEndOfStream)
Response.Write(Pipe.StdOut.ReadLine())
loop
%>
</p>
</body>
</html>
The HelloWorld.exe program is this C++ program:
int main(int argc, char* argv[])
{
printf("Hello World!\n");
return 0;
}
You can test it live here:
http://www.chilkatsoft.com/pipeCgi.asp
It’s also possible to pass command line arguments to the CGI program.