1

I am creating a c# multithread console application, my solution uses +2 projects, 1 as a "main" project, then sub projects as the program's actual functions, however

running a sub project thread runs perfectly, however I would like this thread(s) to open a console of its own,

the only method I am familiar with is launching it separately but that would defeat the purpose of the threading

5
  • Already answered @ stackoverflow.com/questions/1277563/… Commented Jul 12, 2015 at 18:20
  • I'm not sure if this is possible but it isn't a great idea. Writing to separate files is easy, when you need Windows then use WinForms or WPF. Commented Jul 12, 2015 at 18:32
  • @Jay see comment below Commented Jul 12, 2015 at 18:37
  • @HenkHolterman the application runs fine, but I want =this to create another sperate console for output of the main thread, but still use the main console to run other applications "projects linked in the solution", at the moment, when the main applications output is done and reaches the join, it switches to the sub thread which displays its output, but i want these 2 seperate Commented Jul 12, 2015 at 18:39
  • @Jay , also, I looked at the link you posted, i might be mistaken but this refers to only the current window, but keep in mind, all application(the whole solution) ouput points to only 1 console, which is what i dont want Commented Jul 12, 2015 at 18:46

2 Answers 2

2

I have discovered the answer, this question has already been answered, but I will answer my own question in a more understandable way

Open a new console with every new Thread in C#?

Refering to the link above, a poster mentioned that each process can have only 1 console associated with it, thus 1 process -> 1 console

thus for each thread a new console has to be created and assigned to the thread, thus creating a new process with in the thread's code

Sign up to request clarification or add additional context in comments.

1 Comment

If this answers your question, mark it as answered.
1

It's not possible for a process to own multiple consoles, so in order to work you need to start additional processes and send data to them (which is not trivial)

A better solution would be to create a winforms or wpf project and create multiple windows. It's much easier, and the way to go...

1 Comment

thanks for your answer @Phillip W, I posted an answer to this question after having a stroke of luck while doing more googling, seems like this isnt a easy topic to find a solution for...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.