🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

CreateProcess and ExitProcess woes

#14664
From: Mark D
Date: Wed, 06 Aug 2003 13:23
23 lines
1922 bytes
This was on the IDE list - Andrue suggested I try it here,

I neeed to launch an app and close it from within my app.
I've read up on CreateProcess.  I can get the target app running
but all attempts to use ExitProcess give me an AV.  ExitProcess
apparently has to be passed an exit code which you extract using 
the GetExitCodeProcess wind32 API call.  To this function you  
pass the process HANDLE and an LPDWORD - the address of a 32 bit 
variable to which it writes the exit code.

The actual ExitProcess function expects a UINT as the exit code
but I can't get my types to match.  Ie the LPDWORD written to by
GetExitCodeProcess seems to be no good to the ExitProcess call.
Also, I may be passing an invalid handle.  If I extract the 
hProcess value from my ProcInfo instance of PROCESS_INFORMATION
thus 
     HANDLE MyHandle = ProcInfo.hProcess
do I have a valid handle for the call the GetExitCodeProcess.

Thanks for any help.

Mark
Technical Details
Message-ID: <3f31016b@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,e076c50d5b2e440a,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-06 06:41:17 PST
From: "Mark D" <m.davCROPHEREenport@ntlworld.com>
Sender: "Mark D" <m.davCROPHEREenport@ntlworld.com>
Reply-To: "Mark D" <m.davCROPHEREenport@ntlworld.com>
Subject: CreateProcess and ExitProcess woes
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 62.252.128.5 62.252.128.5    
X-Forwarded-For: 62.252.144.164
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3f31016b@newsgroups.borland.com>
Date: 6 Aug 2003 06:23:55 -0700
X-Trace: newsgroups.borland.com 1060176235 207.105.83.65 (6 Aug 2003 06:23:55 -0700)
Lines: 24
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail