in reply to Need a 16 bit returncode from .exe
The perl program correctly reports an exit code of 1289. By the way, I tried the C program using ExitProcess and exit() (C RTL) and both worked. The MSDN gives the return type in ExitProcess as UINT (unsigned int), which is 32 bits.use warnings; use strict; use Win32::Process; use Win32; my $code = 'C:\\Perl Modules\\Win32\\ExitCode\\Debug\\FileClose.exe'; my $ProcessHandle; Win32::Process::Create ( $ProcessHandle, $code, qq("$code" 1289), # Note syntax because path has an embedded space + 0, NORMAL_PRIORITY_CLASS, ".") || die "Oops: $^E"; $ProcessHandle->Wait(INFINITE); my $ExitCode; $ProcessHandle->GetExitCode($ExitCode); print "Exit code: $ExitCode\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need a 16 bit returncode from .exe
by BrowserUk (Patriarch) on Mar 18, 2008 at 18:54 UTC | |
by cdarke (Prior) on Mar 18, 2008 at 19:04 UTC | |
by jimcadd (Novice) on Mar 18, 2008 at 19:47 UTC | |
by jimcadd (Novice) on Mar 18, 2008 at 20:14 UTC | |
by BrowserUk (Patriarch) on Mar 18, 2008 at 20:16 UTC |