Writing your own IDE: How to capture the standard output of a console program in real time in a graphical interface

Source: Internet
Author: User
Tags command line microsoft c visual studio

Write your Own "IDE"--how to capture the standard output of a console program in real time in a graphical interface.

The IDE is the abbreviation for the Integrated development environment (integrated Development environment). There are a lot of good Ides, like JBuilder and Kylix, like Visual Studio. I do not know whether you have noticed that most of the IDE itself only provides code editing, engineering management, such as human-computer interaction functions, when we compile code in the IDE, debug the program, the IDE needs to invoke the command line compiler, the debugger to complete the appropriate action. For example, when you compile a C + + program using Visual Studio, we see the entire process of compiling and connecting in the Output window below the IDE, although we don't see the pop-up dos window, but actually the IDE starts Microsoft C + + Compiler cl.exe and connectors link.exe both command-line programs, while Cl.exe and link.exe outputs are reflected in the IDE's output window in real time. Also, we can configure the tools we need (such as special compilers) in Visual Studio, and then let Visual Studio run the tools at the right time and display the output of the utility program to the Output window in real time. The following figure is a scenario where I run J2SDK in Visual Studio 6.0 's Output window to compile the Java source program and display a syntax error in the program: Javac.exe

That is, most IDE tools can invoke specific command-line programs in the integrated environment (more specifically the console program in WIN32), and then capture their output in real time (which is mostly output to the standard stdout and stderr streams), and displays the captured information in the graphical interface window.

This is clearly a potentially valuable feature. Using this technology, we can at least

1. Write your own IDE, if we have enough patience;

2. Embed Full-text search functionality in our own applications (invoke the Grep.exe tool in Borland C + +), or compress and decompress (the compression decompression program that invokes the console mode, such as Arj.exe, Pkzip.exe, etc.);

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.