Output from form application to console

Asked 1 years ago, Updated 1 years ago, 92 views

Development Environment: Visual Studio 2012


for projects created as form applications System::Console::WriteLine("XXXX";To print to a command prompt,
Which part of the project properties should I change?

Hit YYY.exe at the command prompt and run
Please tell me the properties settings for standard output on the command prompt.

In addition, it is not acceptable to use the console application from the beginning.
There is a reason to create it as a form application.
There should be some configuration to change the standard output of a form application like a console application, but I can't find it.
以前 I've done the same thing before, so I should be able to do it

windows c++-cli command-prompt

2022-09-30 18:10

2 Answers

Hit YYY.exe at the command prompt and run
Please tell me the properties settings for standard output on the command prompt.

You can do this by invoking AttachConsole (ATTACH_PARENT_PROCESS);.Of course, if you boot from a non-command prompt, you will not see anything because there is no destination to display.

Note that the invoking command prompt, after starting the process of the form application, accepts the following commands by displaying the prompt:

The question is, where are the settings on the properties page to enable System::Console::WriteLine("XXXX")?

From Windows (/SUBSYSTEM:WINDOWS) to
Subsystem items in Linker-
This can be achieved by changing to Console(/SUBSYSTEM:CONSOLE), but this setting is the setting that determines the difference between the form and console applications, so I excluded it from the answer because changing it would be "Create from scratch."


2022-09-30 18:10

https://msdn.microsoft.com/ja-jp/library/fcc1zstk(v=vs.110).aspx
You can refer to the VS2012 configuration steps in .

To set this linker option in a Visual Studio development environment

Dear @sayuri,
As it says, I don't know if this is what I want to do.


2022-09-30 18:10

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.