httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jlwpc1" <>
Subject Re: A solution to the Win32 console problem
Date Tue, 20 Jun 2000 06:09:13 GMT
From: William A. Rowe, Jr. <>

Here are some Window ways to handle - "but I can not read the error screen troubles"!

If the Apache program started but quickly quits and assuming there is a user (nearby) why
not call the default browser with the new, improved and soon to be written (by someone  who
knows the options?) "Windows Apache Install and Run Options" html file (or to please the "others"
just in big red html style letters RTFM)? :)

define NO_SERVER_NAME  13 (a number to report to "auto-loaders" via bat files)
define NO_RUN_OPTIONS    12 (a number to report to "auto-loaders" via bat files)

    Error - no options so quit like this:
    GetModuleFileName(to get path to html file where apache.exe is)
    lstrcat(add error filename to above path)
    ShellExecute(NULL,"open", path from above with error html filename, NULL, NULL, 
                 SW_SHOWNORMAL) - displays the default browser with html file

Real life Example:
rc = ShellExecute(NULL, "open", "c:\\windows\\help\\LICENSE.HTM", NULL, NULL, SW_SHOWNORMAL);
 This displays in the default browser the html file.

Apache.exe quits (is gone) but the user is left reading in the users default browser  "Error
- Apache started without any options -please click on link Windows Apache Install and Run
Options" The options list is explained and tells the user to kill the browser and start over.

If no browser was found then use Windows help file - winhelp.exe (Someone will have to write
the help file). or win32hlp.exe

Example: start another program to display error info.
(use Apache stuff in real life)

GetWindowsDirectory(path to Windows);    
lstrcat(add filename.exe this time to path) 
ShellExecute(NULL, "open", "path to Windows\\winhelp.exe\\", "calc.hlp", NULL, SW_SHOWNORMAL);
- start winhelp.exe and display the calculator's help file.
or CreateProcess() to Winhelp() "RTFM.fileName"
or ShellExecuteEx for error display files and WaitFor() funcs.

After calling the browser/Windows help file Apache dies (is gone) and the user reads on about
the service already installed error in another process via another program. 

Apache.exe is running but what no server name in conf:
    Error - no server name so quit like this:
    GetModuleFileName(to get path to html file where apache.exe is)
    lstrcat(error html file name to path above)
    ShellExecute(NULL,"open", path above with html filename, NULL, NULL, 

Apache.exe quits (is gone) but the user is left reading "Error No Server Name Defined" html
file in the users default browser and/or help window.  

Also it is best to default to .htm instead of .html for the default browser info to be found
in the registry for ShellExecute calls.

There can be a separate html file for every Windows Apache error defined and/or end by saying
do this to this and restart Apache by whatever. Or combine them all in one (dll or a large
html or whatever) and display only the needed error message.

Now if there is no user - just test and well time the error process! The other process will
not stop an auto-loader from restarting Apache.exe since Apache.exe process is gone and the
Windows help/browser/console text/whatever is in another process. If there is a "problem"
with "too many" other processes out there for the auto-load servers then check for these processes
at Apache start and kill them off.  Start all error files with the words Apache Error #whatever
in the title to make finding them quick and easy.  Also services should not display other
consoles and/or windows so plan for other log errors for services.

> For 2.0, your solution is 100% reasonable, and yes, we need to
> pass on __FILE__ and __LINE__ in any case, to help shoot down
> any problems.  I'll start thinking 2.0 exit() again in July, and
> probably borrow quite a bit of your code.

Always use debugging ways like this one.

I think 2.0 must now start differently than 1.3 - perhaps in another message Apache 2.0 Windows
start should be outlined.


View raw message