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

.NET (Core and Framework)

 
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 
I have a time consuming process that is called from a Windows forms application and run asynchronously in another thread, when the user clicks on runButton
extProcess = gcnew System::Diagnostics::Process;
extProcess->StartInfo = gcnew System::Diagnostics::ProcessStartInfo;
extProcess->StartInfo->RedirectStandardOutput = true;
extProcess->StartInfo->UseShellExecute = false;	//Necessary to redirect
extProcess->StartInfo->FileName = EXTPROC_EXE;
extProcess->StartInfo->CreateNoWindow = true;		//Don't open a new window for Process
extProcess->OutputDataReceived += gcnew System::Diagnostics::DataReceivedEventHandler (this, &Form1::StdoutHandler);
try
{
	extProcessThread->RunWorkerAsync();

The thread is launched and the standard output is read, to be shown in real time in a textBox in the main window
void extProcessThreadDoWork (System::Object^ sender, System::ComponentModel::DoWorkEventArgs^ e)
{
	extProcess->Start();
	extProcess->BeginOutputReadLine();
}
void Form1::StdoutHandler (Object ^ sender,
	 System::Diagnostics::DataReceivedEventArgs ^output)
 {
	 //Get text
	 textBox->AppendText (output->Data + "\n");
 }

The problem comes in this last line. An exception is launched "Control accessed from a thread other than the thread it was created on"
I do understand why, but I don´t know how to solve it...
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 
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 

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.