Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do I read Dos ErrorLevels from Delphi

Posted on 1997-08-08
5
Medium Priority
?
382 Views
Last Modified: 2010-04-04
My App calls a legacy DOS program which sometimes produces an error.  I need to trap the ErrorLevel from DOS when control is returned to my prog so I can advise the user to take the appropriate action.

How do I read the ErrorLevel??
0
Comment
Question by:jdthedj
[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
  • 3
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
ygolan earned 800 total points
ID: 1340872
Use CreateProcess to run the application.Use the process handle returned in the lpProcessInformation record to WaitForSingleObject, then use it with GetExitCodeProcess.

Here  is the pseudo code :

CreateProcess(...., ProcessInformat);
WaitForSingleObject(ProcessInformation.hProcess, INFINITE);
GetExitCodeProcess(ProcessInformation.hProcess, ExitCode);
0
 
LVL 3

Author Comment

by:jdthedj
ID: 1340873
I am using D1 and I have looked in Delphi help and WinApi help but cannot find reference to the commands mentioned in the answer.  Is there a different method using D1??
0
 
LVL 1

Expert Comment

by:ygolan
ID: 1340874
With D1 it is a lot more complicated...

Tell you what - raise the points to 300 and give me your email address, and I'll email you XSpawn - it's a product we used to sell that solves this problem for D1, but we no longer sell it (do not wish to provide technical support for it anymore...)
0
 
LVL 3

Author Comment

by:jdthedj
ID: 1340875
I'd love to raise the points to 300, but I am new to this and only have 205 available.  If you're feeling generous my email address is johnd@caverock.co.nz.  Maybe I can make it up later??
0
 
LVL 1

Expert Comment

by:ygolan
ID: 1340876
Should be in your mail box any minute now...

As for the points, don't worry about them, no need to make it up.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

636 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