?
Solved

Getting the values returned by the executable invoked by createprocess

Posted on 2003-03-14
2
Medium Priority
?
169 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
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…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
Suggested Courses

765 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