🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.nativeapi
Article #88

Re: CreateProcess(nil, ReturnCode.Exe...parms...)

#88
From: M�rio Reis
Date: Thu, 22 Jan 2004 17:39
46 lines
3049 bytes
 The only refrence to this API ... WinExecAndWait32V2 it's yours. Where can
i find it?

 However here goes a small idea of what i need to do.

In a MS-DOS windows this linecmd: 'cusrmgr -u Administrator -m
\\10.31.17.069 -P >>bcaXpTy<<'; returns a
*** ERROR *** RC:0x0035... *** ERROR *** RC:0x0037 etc...
In my progrma
        OK:=RunProgram('C:\WINNT\system32\cusrmgr -u Administrator -m \\'+
TblIpAIP_ADRESS.Text+' -P bcaPwd....');
 If CreateProcess(Nil,PChar(ExeProgram),Nil,Nil,False,

PROCESS_QUERY_INFORMATION+SYNCHRONIZE+CREATE_NEW_PROCESS_GROUP+NORMAL_PRIORI
TY_CLASS,
                                                 Nil, Nil, SI, Pi) Then
    begin
       While PIDExists(pi.dwProcessId) do
         Application.ProcessMessages;

Later i tried both:   GetExitCodeProcess(pi.hProcess,pi.dwProcessId) and
GetLastError,  but i allways get the same Return Code for those cases where
there is a valid ipadress or a non valid ipadress machine ( as it was a
succeful change even on a non existing IPADRESS ).

Thank you any way


"Rob Kennedy" <.> wrote in message news:400c3a38$1@newsgroups.borland.com...
> "M??????????????????????????" wrote:
> > I already tried but it returns me the same code for a none existing
IpAdress
> > then for an existing IPAdress...
>
> Neither CreateProcess nor GetExitCodeProcess returns an IP address.
> Would you mind explaining what you're really trying to do?
>
> Keep in mind that GetExitCodeProcess only returns a meaningful value if
> the process has actually exited. If the process is still running, then
> you obviously can't get its exit code. If you want to wait for a process
> to terminate, then call WaitForSingleObject. Search the newsgroup
> archives for WinExecAndWait32V2; it encapsulates the whole sequence for
you.
>
> --
> Rob
Technical Details
Message-ID: <40100b27@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!216.196.98.140.MISMATCH!border1.nntp.ash.giganews.com!nntp.giganews.com!diablo.voicenet.com!newsfeed.hal-mli.net!feeder2.hal-mli.net!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <400bf35d$1@newsgroups.borland.com> <VA.0000a8b8.004f4ce8@nomail.please> <400c2fbd$1@newsgroups.borland.com> <400c3a38$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f94dd,20f4094e096ad01b
X-Google-Attributes: gidf94dd,public
X-Google-ArrivalTime: 2004-01-22 10:03:51 PST
From: "M�rio Reis" <m.reis@bca.pt>
Newsgroups: borland.public.delphi.nativeapi
References: <400bf35d$1@newsgroups.borland.com> <VA.0000a8b8.004f4ce8@nomail.please> <400c2fbd$1@newsgroups.borland.com> <400c3a38$1@newsgroups.borland.com>
Subject: Re: CreateProcess(nil, ReturnCode.Exe...parms...)
Date: Thu, 22 Jan 2004 16:39:06 -0100
Lines: 48
Organization: BCA
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4927.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200
NNTP-Posting-Host: 195.35.96.89
Message-ID: <40100b27@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1074793255 195.35.96.89 (22 Jan 2004 09:40:55 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!216.196.98.140.MISMATCH!border1.nntp.ash.giganews.com!nntp.giganews.com!diablo.voicenet.com!newsfeed.hal-mli.net!feeder2.hal-mli.net!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail