🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #4982

Re: CreateProcess return error 126

#4982
From: Remy Lebeau (TeamB)
Date: Sat, 22 Oct 2005 02:18
23 lines
2047 bytes
"Orlando Lopez" <hlopezrd@hotmail.com> wrote in message
news:435970ff$1@newsgroups.borland.com...

>     String cmd = "cmd.exe /C " + this->AppPath + "FSUM.EXE -sha1 " +
filein + ">"+fileout;

You did not specify a full path to cmd.exe.  Also, you are not taking the
OS's version into account.  WinNT/W2K/XP/W2K3 use cmd.exe, whereas Win9x/ME
systems use command.com instead.  You can use the COMSPEC environment
variable to retrieve the version-dependant filename.  Actually, you don't
even need to use cmd.exe or command.com at all.  You can execute FSUM.EXE
directly instead.

Alternatively, use system() instead of CreateProcess() for command-line
commands, especially since you are using the ">" redirection pipe.  If you
want to use CreateProcess() with redirection, then you should make use of
the STARTF_USESTDHANDLES flag in the STARTUPINFO structure.  You can use
CratePipe() to provide your own hStdOut and hStdErr handles, and then use
ReadFile() and WriteFile() to pipe the data into your output file manually.


Gambit
Technical Details
Message-ID: <4359a101@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!nntp.waia.asn.au!zen.net.uk!dedekind.zen.co.uk!news-out.usenet.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43590889$1@newsgroups.borland.com> <43592d69$1@newsgroups.borland.com> <435970ff$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a3597fcd3a80013b
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <43590889$1@newsgroups.borland.com> <43592d69$1@newsgroups.borland.com> <435970ff$1@newsgroups.borland.com>
Subject: Re: CreateProcess return error 126
Date: Fri, 21 Oct 2005 19:18:36 -0700
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <4359a101@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1129947393 68.69.17.41 (21 Oct 2005 19:16:33 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!nntp.waia.asn.au!zen.net.uk!dedekind.zen.co.uk!news-out.usenet.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail