Click here to Skip to main content
15,886,873 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Process::HasExited always true Pin
Eddy Vluggen16-Feb-11 2:07
professionalEddy Vluggen16-Feb-11 2:07 
QuestionAccessing control from a different thread Pin
piul14-Feb-11 23:18
piul14-Feb-11 23:18 
AnswerRe: Accessing control from a different thread Pin
piul14-Feb-11 23:41
piul14-Feb-11 23:41 
AnswerRe: Accessing control from a different thread Pin
Simon_Whale14-Feb-11 23:59
Simon_Whale14-Feb-11 23:59 
AnswerRe: Accessing control from a different thread Pin
Luc Pattyn15-Feb-11 3:14
sitebuilderLuc Pattyn15-Feb-11 3:14 
QuestionExternal process stops everything else Pin
piul14-Feb-11 0:31
piul14-Feb-11 0:31 
AnswerRe: External process stops everything else Pin
Luc Pattyn14-Feb-11 1:06
sitebuilderLuc Pattyn14-Feb-11 1:06 
GeneralRe: External process stops everything else Pin
piul14-Feb-11 2:25
piul14-Feb-11 2:25 
The application is a dialog that runs a long mathematical calculation (the external process, an independent executable) when pressing a Run button. Hence, this code is located within the buttonRun_Click function.
while (!superMinerProcess->HasExited)
{
	if (processCancelled)
	{
		processCancelled = false;
		break;
	}
}

processCancelled is set to true in buttonCancel_Click. What I´m trying is to be able to kill the process when the user clicks on the Cancel button. I´ve tried writing superMinerProcess->Kill() in buttonCancel_Click but it won´t work because the Cancel button is just not clickable while the process is running.

Here´s the rest of relevant code of the process
superMinerProcess = gcnew System::Diagnostics::Process;
superMinerProcess->StartInfo = gcnew System::Diagnostics::ProcessStartInfo;
superMinerProcess->StartInfo->RedirectStandardOutput = true;
superMinerProcess->StartInfo->UseShellExecute = false;	//Necessary to redirect
superMinerProcess->StartInfo->FileName =  SUPERMINER_EXE;
superMinerProcess->StartInfo->CreateNoWindow = true;		//Don't open a new window for Process
//Arguments	
superMinerProcess->StartInfo->Arguments = getArguments();
superMinerProcess->OutputDataReceived += gcnew System::Diagnostics::DataReceivedEventHandler (&Form1::StdoutHandler);

GeneralRe: External process stops everything else Pin
Luc Pattyn14-Feb-11 2:37
sitebuilderLuc Pattyn14-Feb-11 2:37 
GeneralRe: External process stops everything else Pin
piul14-Feb-11 4:34
piul14-Feb-11 4:34 
AnswerRe: External process stops everything else Pin
Luc Pattyn14-Feb-11 4:43
sitebuilderLuc Pattyn14-Feb-11 4:43 
GeneralRe: External process stops everything else Pin
piul14-Feb-11 5:08
piul14-Feb-11 5:08 
GeneralRe: External process stops everything else Pin
Luc Pattyn14-Feb-11 5:51
sitebuilderLuc Pattyn14-Feb-11 5:51 
GeneralRe: External process stops everything else Pin
piul14-Feb-11 5:59
piul14-Feb-11 5:59 
QuestionInfinite recursion wont go away. Pin
Herboren13-Feb-11 13:27
Herboren13-Feb-11 13:27 
AnswerRe: Infinite recursion wont go away. Pin
Dave Kreskowiak13-Feb-11 15:38
mveDave Kreskowiak13-Feb-11 15:38 
AnswerRe: Infinite recursion wont go away. Pin
Luc Pattyn14-Feb-11 1:10
sitebuilderLuc Pattyn14-Feb-11 1:10 
JokeRe: Infinite recursion wont go away. Pin
musefan14-Feb-11 5:15
musefan14-Feb-11 5:15 
GeneralRe: Infinite recursion wont go away. Pin
Henry Minute14-Feb-11 5:24
Henry Minute14-Feb-11 5:24 
JokeRe: Infinite recursion wont go away. Pin
musefan14-Feb-11 5:44
musefan14-Feb-11 5:44 
GeneralRe: Infinite recursion wont go away. Pin
Henry Minute14-Feb-11 5:49
Henry Minute14-Feb-11 5:49 
GeneralRe: Infinite recursion wont go away. Pin
musefan14-Feb-11 6:04
musefan14-Feb-11 6:04 
QuestionClick on the hyperlink and become an alert icon and also save to database Pin
Peggie199013-Feb-11 12:53
Peggie199013-Feb-11 12:53 
QuestionHow to Detect Music Device Pin
Pranit Kothari11-Feb-11 19:15
Pranit Kothari11-Feb-11 19:15 
AnswerRe: How to Detect Music Device - Repost Pin
Richard MacCutchan11-Feb-11 21:10
mveRichard MacCutchan11-Feb-11 21:10 

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.