stdcxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig Chariton <chari...@roguewave.com>
Subject RE: Scripting Errors in Error Paths for Windows Scripts?
Date Tue, 28 Mar 2006 22:33:11 GMT

After playing with this some more, it appears that this will be acceptable.
The host executable appears to be set to cscript in various places, so I
believe that this will permit WScript.StdErr to be used without error.  If
someone stumbles across an example where there is a problem, please post it.

Craig Chariton


-----Original Message-----
From: Craig Chariton [mailto:chariton@roguewave.com] 
Sent: Friday, March 24, 2006 4:52 PM
To: 'stdcxx-user@incubator.apache.org'
Subject: Scripting Errors in Error Paths for Windows Scripts?

 

Before Martin set me straight on how to build the library for Windows, I was
getting errors off of the scripts in the \etc\config\windows directory.  I
was getting an error off of this section of code in generate.wsf:

 

function readAndCheckArguments()

{

    if (!WScript.Arguments.Named.Exists("CONFIG"))

    {

        WScript.StdErr.WriteLine(

            "Generate: Missing required argument.");

        WScript.Arguments.ShowUsage();

        WScript.Quit(2);

    }

  

 

The error would occur at WScript.StdErr.WriteLine(.  I would get error code
80070006, Handle Is Invalid.  When I got this error the script would hang
and not exit gracefully.

 

I finally stumbled across this Web page:

 

http://www.devguru.com/Technologies/wsh/quickref/wscript_StdErr.html
<http://www.devguru.com/Technologies/wsh/quickref/wscript_StdErr.html> 

 

According to this page, StdErr can only be used when cscript is the host
executable.  The page further states that the Handle Is Invalid message will
be generated if you attempt to use this property when running a script under
wscript.

 

I am not knowledgeable in this area.  Can anyone confirm that this is true?
There is a lot of usage of WScript.StdErr throughout the scripts.  It may
just be related to what I was doing at the time and not a problem.  However,
if there is a problem with this usage, the scripts should be corrected.

 

Craig Chariton

 

 


Mime
View raw message