简体   繁体   中英

How do I open a new console window for a Visual C++ console application?

What I want to do is something like this:

ConsoleWindow1.Print("1");
ConsoleWindow2.Print("2");

When I run the program, two console windows pop up and one gets printed with 1 and the other gets printed with 2. Is there a simple way of doing this?

For console based application there can be only one console per process. You can start two processes and then do some sort of IPC to coordinate with each other

我看到的一种方法是,编写一个控制台,打印输出给exe的参数,并编写另一个使用不同参数调用这两个应用程序的程序,我没有尝试过,但是可能是您可以通过WIN32函数打开两个程序,请参见如何在Windows中打开控制台窗口。 Win32应用程序

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM