Debug a program's command-line parameter pass __programming in Visual Studio

Source: Internet
Author: User

Tested personally: VS6, VS2005, VS2010, etc. the IDE does not support the delivery of multiple command-line arguments (estimated 2003, 2008 also), but it is possible to code through the WinMain main function command-line arguments PSTR szCmdLine (MFC is M_ lpCmdLine) receives a string with a carriage return line feed.

With IDE debugging to set parameters, vs only one row, no matter how you set up in the relevant engineering files to deceive the IDE, or in the IDE with ALT+13, alt+10 to simulate carriage return line break, there is no effect. In the Internet, whether Chinese or english have been searched, did not see the solution.

So the only way to solve this case is to flatten the multiple rows of arguments into one line, the original line terminator is simulated with a special character insertion that does not conflict, and the main entrance of the program is then made again the original line with newline parameters, the special character to revert to the previous line break, this process can write a function, to reuse.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.