Allgemeine Fragen zur PROFAN Programmierung
Views (Heute): 242961 (4397)
  Suchen
 Zurück zur Übersicht
 AutorThema: C++ Returnwerte abfragen
Rupert Ecker
Datum:21.05.02 14:48 Antwortenals Email verschicken (rupert.ecker@univie.ac.at) 


Hallo Leute,

Ich rufe mit WinExec ein C++ Programm auf. Dieses wird mit einem bestimmten Exit-Wert beendet. Wie kann ich diesen Wert in Profan (7.5) abfragen?? WinExec liefert ja nur den Handle...??

Danke und viele Grüße
Rupert


Sven Schmidts
Datum:21.05.02 15:47 Antwortenals Email verschicken (schmidts@flat2serv.de) 


Hallo,

das ist nicht nur auf C++ beschränkt, ist eine Windows Funktion ;) Du benötigst die API "GetExitCodeProcess" (Kernel32.dll). Da Du das Handle hast, ist es recht einfach. Hier der Auszug aus der API:

"
The GetExitCodeProcess function retrieves the termination status of the specified process.

BOOL GetExitCodeProcess(
HANDLE hProcess, // handle to the process
LPDWORD lpExitCode // address to receive termination status
);

Parameters

- hProcess
Identifies the process.
Windows NT: The handle must have PROCESS_QUERY_INFORMATION access. For more information, see Process Objects.

- lpExitCode
Points to a 32-bit variable to receive the process termination status.

Return Values
If the function succeeds, the return value is nonzero.
"

Mfg.
Sven Schmidts


Philipp Sternberg
Datum: 22.05.02 13:34 Antwortenals Email verschicken (ps@burghardt-ib.de) 


Hallo,

dazu mal ne kurze Frage: ist auch mit Profan irgendwie möglich so einen Rückgabewert beim Beenden zu erzeugen ??


 Zurück zur Übersicht