?
Solved

Getting the values returned by the executable invoked by createprocess

Posted on 2003-03-14
2
Medium Priority
?
173 Views
Last Modified: 2012-05-04
Hi
     I am invoking an executable using the CreateProcess Api call , i want to check the error code/return values returned by the called executable. I need some help in solving this problem, urgently

thanx in advance
regards
Prasanna
0
Comment
Question by:DiGiTaL
2 Comments
 
LVL 3

Accepted Solution

by:
Nosfedra earned 750 total points
ID: 8135107
Have you tried GetExitCodeProcess?
See the MSDN for that.
0
 
LVL 5

Expert Comment

by:Kocil
ID: 8136732
To make it clear :)

     PROCESS_INFORMATION ProcessInfo;
        DWORD retcode;

        ...
     if (!CreateProcess( NULL, Args, NULL, NULL, FALSE,
          CREATE_NEW_CONSOLE,
          NULL,
          NULL,
          &StartupInfo,
          &ProcessInfo))
     {
          return GetLastError();          
     }

     WaitForSingleObject(ProcessInfo.hProcess,INFINITE);
     if(!GetExitCodeProcess(ProcessInfo.hProcess, &retcode))
          retcode = 0;

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question