Hello
I've finally found a solution for the blocked
anlgform when called from html page.
The solution is somewhere in MS Konwledge base,
article ID: Q194948
I'll quote relevant part:
======================================================================
SUMMARY
=======
When using the C-runtime routine _popen() to create a child process from
^^^^^^^^
anlgform.c has popen instead ?
within a CGI process, there are several issues regarding the mapping of
STDIN and STDOUT (also STDERR) handles. By default Internet Information
Server (IIS) 3.0 and 4.0 will not create a console when a CGI process is
created. The STDIN and STDOUT of the CGI process and that of the child
process (created from the CGI process) will not be mapped correctly.
..... blah and some more blah ....
There are two ways to work around this default behavior.
- Force IIS to launch all CGI application with their own console. Under
IIS 3.0 this is done through the CreateProcessWithNewConsole DWORD
registry entry under HKLM\CurrentControlSet\Services\W3SVC\Parameters to
1. Under IIS 4.0, this is done by setting the
MD_CREATE_PROC_NEW_CONSOLE entry in the metabase with IIS Admin Base
Objects or corresponding CreateCGIWithNewConsole property with IIS Admin
Objects to TRUE (see IIS 4.0 online documentation).
- If altering the configuration of IIS is not an option, you can
programmatically guarantee that the parent process will have a console
by issuing the AllocConsole() call. This call will fail if the parent
already has a console. But if the console does not exist, it will
allocate one and attach the parent process to this console.
NOTE: AllocConsole() call must be issued before the _popen() call is
made; Otherwise, the resulting allocated console's standard I/O handles
will not have been picked up by the _popen() routine.
======================================================================
I don't know how to implement the second solution, so I've tried the
first and this works for my NT/IIS4 combination.
I used program called 'metaedit' to edit IIS4 metabase (this program
is included in IIS Resource Kit).
Go to LM/W3SVC and expand. Look for entry ID 6036. It's probably not
there, so you'll have to add it by hand. So, add new DWORD, in ID field
enter 6036, Attributes: inherit, User Type: File, Data Type: Dword, Data:
1.
Click OK, and there should be a new entry, like this:
ID Name Attributes UT DT Data
6036 CreateCGIWithNewConsole Inh File DWord 1
BTW, if you go to Schema/Properties/Names you'll find entry for
6036/Create...
so that's how I've found it.
Now we can all start to use this great program....
Cheers,
Tom
PS: Here is a part of the code that I have to change to compile anlgform
with MSVC++5
/* start program */
if (settings)
thepipe = stdout;
#ifdef _WIN32
#ifdef __CYGWIN__
else if ((thepipe = popen(ANALOG " +g-", "w")) == NULL)
my_exit(POPEN_FAILED);
#else
else if ((thepipe = _popen(ANALOG " +g-", "w")) == NULL)
my_exit(POPEN_FAILED);
#endif
#else
else if ((thepipe = popen(ANALOG " +g-", "w")) == NULL)
my_exit(POPEN_FAILED);
#endif
..............
/* wind up */
if (!settings) {
settings = fflush(thepipe);
#ifdef _WIN32
#ifdef __CYGWIN__
if ( (settings = pclose(thepipe)) != 0)
my_exit(PCLOSE_FAILED);
#else
if ( (settings = _pclose(thepipe)) != 0)
my_exit(PCLOSE_FAILED);
#endif
#else
if ( (settings = pclose(thepipe)) != 0)
my_exit(PCLOSE_FAILED);
#endif
--------------------------------------------------------------------
This is the analog-help mailing list. To unsubscribe from this
mailing list, send mail to [EMAIL PROTECTED]
with "unsubscribe analog-help" in the main BODY OF THE MESSAGE.
--------------------------------------------------------------------