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

.NET (Core and Framework)

 
GeneralRe: How to get my Word templates and AutoTexts with Interop? [modified] Pin
musefan16-Feb-11 4:05
musefan16-Feb-11 4:05 
GeneralRe: How to get my Word templates and AutoTexts with Interop? [modified] Pin
musefan16-Feb-11 4:13
musefan16-Feb-11 4:13 
GeneralRe: How to get my Word templates and AutoTexts with Interop? Pin
Bernhard Hiller16-Feb-11 20:00
Bernhard Hiller16-Feb-11 20:00 
AnswerRe: How to get my Word templates and AutoTexts with Interop? Pin
Bernhard Hiller16-Feb-11 20:41
Bernhard Hiller16-Feb-11 20:41 
QuestionHow to resolve sgen.exe error Pin
meeram39515-Feb-11 21:37
meeram39515-Feb-11 21:37 
AnswerRe: How to resolve sgen.exe error Pin
Richard MacCutchan15-Feb-11 23:02
mveRichard MacCutchan15-Feb-11 23:02 
AnswerRe: How to resolve sgen.exe error Pin
Yusuf16-Feb-11 3:21
Yusuf16-Feb-11 3:21 
QuestionProcess::HasExited always true Pin
piul15-Feb-11 2:07
piul15-Feb-11 2:07 
AnswerRe: Process::HasExited always true Pin
Luc Pattyn15-Feb-11 3:10
sitebuilderLuc Pattyn15-Feb-11 3:10 
GeneralRe: Process::HasExited always true Pin
piul15-Feb-11 3:20
piul15-Feb-11 3:20 
GeneralRe: Process::HasExited always true Pin
Ravi Sant15-Feb-11 3:42
Ravi Sant15-Feb-11 3:42 
AnswerRe: Process::HasExited always true Pin
RobCroll15-Feb-11 4:20
RobCroll15-Feb-11 4:20 
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 

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.