Click here to Skip to main content
15,917,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A simple linking question Pin
Themis17-Jul-03 1:42
Themis17-Jul-03 1:42 
GeneralCButton MouseDown Pin
shinay16-Jul-03 20:37
shinay16-Jul-03 20:37 
GeneralRe: CButton MouseDown Pin
Fredrik Skog16-Jul-03 21:00
Fredrik Skog16-Jul-03 21:00 
GeneralRe: CButton MouseDown Pin
sdfdsfa17-Jul-03 5:52
sdfdsfa17-Jul-03 5:52 
GeneralRe: CButton MouseDown Pin
Fredrik Skog17-Jul-03 20:43
Fredrik Skog17-Jul-03 20:43 
GeneralRe: CButton MouseDown Pin
sdfdsfa18-Jul-03 5:58
sdfdsfa18-Jul-03 5:58 
QuestionHow to input Greek Pin
winncle16-Jul-03 20:29
winncle16-Jul-03 20:29 
GeneralProcess: Create and Destroy Pin
Imtiaz Murtaza16-Jul-03 20:28
Imtiaz Murtaza16-Jul-03 20:28 
I have a "parent" application. I want to create and destroy a child process using the parent application. I am successfully creating a new process (notepad) but unable to destroy it. Can any one tell me how to destroy a process ?

For creation of process i am doing something like:

STARTUPINFO si;
PROCESS_INFORMATION pi;

GetStartupInfo(&si);
   
  ::CreateProcess(NULL, "notepad",  // Name of app to launch
	NULL,      // Default process security attributes
	NULL,      // Default thread security attributes
	TRUE,      // Don't inherit handles from the parent
	0,			// Normal priority
	NULL,      // Use the same environment as the parent
	NULL,      // Launch in the current directory
	&si,      // Startup Information
	&pi);      // Process information stored upon return


and for ending process i am doing:

DWORD exitCode ;

BOOL a =::GetExitCodeProcess(pi.hProcess, &exitCode);

   ::ExitProcess(exitCode);


But when i try to end process my parent process destroys itself. Very strange that if i use TerminateProcess instead of ExitProcess, the child process successfully ends. But i want to use ExitProcess because MSDN recommends it. What is the problem here ?

Imtiaz
GeneralRe: Process: Create and Destroy Pin
Ryan Binns16-Jul-03 21:21
Ryan Binns16-Jul-03 21:21 
GeneralRe: Process: Create and Destroy Pin
Mike Dimmick16-Jul-03 22:44
Mike Dimmick16-Jul-03 22:44 
GeneralRe: Process: Create and Destroy Pin
Ryan Binns16-Jul-03 22:58
Ryan Binns16-Jul-03 22:58 
Generalsize of the capture image Pin
Chen Jiadong16-Jul-03 19:20
Chen Jiadong16-Jul-03 19:20 
GeneralRe: size of the capture image Pin
Andrew Walker17-Jul-03 2:37
Andrew Walker17-Jul-03 2:37 
Generalwave/in problem with TAPI Pin
ewasta16-Jul-03 19:16
ewasta16-Jul-03 19:16 
GeneralMouse Hooking problem!!!!! Pin
xxhimanshu16-Jul-03 18:28
xxhimanshu16-Jul-03 18:28 
GeneralRe: Mouse Hooking problem!!!!! Pin
PJ Arends17-Jul-03 7:01
professionalPJ Arends17-Jul-03 7:01 
GeneralRe: Mouse Hooking problem!!!!! Pin
xxhimanshu18-Jul-03 18:53
xxhimanshu18-Jul-03 18:53 
Generalusing ADO Pin
Angel Kid16-Jul-03 16:42
Angel Kid16-Jul-03 16:42 
GeneralRe: using ADO Pin
Toni7816-Jul-03 18:58
Toni7816-Jul-03 18:58 
GeneralDetect Internet Connection Pin
Abhi@Work16-Jul-03 15:48
Abhi@Work16-Jul-03 15:48 
GeneralRe: Detect Internet Connection Pin
Toni7816-Jul-03 16:00
Toni7816-Jul-03 16:00 
GeneralRe: Detect Internet Connection Pin
Abhi@Work16-Jul-03 17:12
Abhi@Work16-Jul-03 17:12 
GeneralRe: Detect Internet Connection Pin
Ryan Binns16-Jul-03 17:37
Ryan Binns16-Jul-03 17:37 
General***Clickety police*** Pin
Toni7816-Jul-03 18:56
Toni7816-Jul-03 18:56 
GeneralRe: ***Clickety police*** Pin
Ryan Binns16-Jul-03 19:07
Ryan Binns16-Jul-03 19:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.