Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6940251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:43:42+00:00 2026-05-27T12:43:42+00:00

So im working on making an automated test for some code. There is an

  • 0

So im working on making an automated test for some code. There is an executable run from the command line called “cmdLineProc”.

Im making my test programs in C++ (not using Python or that cos theres an API we use that speeds these tests up).
The command line arguments are made in the test as strings and passed to a function that uses CreateProcess to run cmdLineProc..
This works fine. I can call cmdLineProc and it works and the tests pass. But only when theres not an error returned.

When testing I obv need to check that things are failing when they are supposed to as well. in these cases cmdLineProc returns an error value.

So if i run cmdLineProc on the command line with parameters that will make it fail, i get a message saying “Error, Failed: -3” where -3 is an error code.
But when i run this through the C++ test using CreateProcess I get a problem. The CreateProcess just fails and returns -1, the code to say it failed. It gives no indication of why it failed.
I use GetExitCodeProcess to get the termination status of the cmdLineProc.

Anyone know if its possible to get the error value from cmdLineProc returned back using this method? If not does anyone know how i might go about implementing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:43:43+00:00Added an answer on May 27, 2026 at 12:43 pm

    GetExitCodeProcess returns the exit code of the run process. If you see another error displayed when you run the program then the created process is simply writing another error to stdout.

    In that case you’ll have to parse the output of the created process.

    You can see how that is done here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with some example java code for making md5 hashes. One part converts
I'm working on a finite deterministic automaton based on this . From this code:
I am working on some code coverage for my applications. Now, I know that
I am currently working on making my code contain more generics. I encountered a
I'm working on making a receipt for my registration code and I keep getting
I'm working on making a simple server application with python, and I'm trying to
I'm working on making 3 VM versions of XP with IE6, 7, and 8
I'm working on making an ASCII based game, and everywhere I look people are
I am working on making a new SQLite database. Obviously for a number of
I am working on making a simple drawing program. So far I am able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.