Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VC++ MS-DOS Scroll-Back?

Posted on 1998-04-19
1
Medium Priority
?
394 Views
Last Modified: 2006-11-17
To maintain portability with the UNIX text system, I'm using a MS-DOS box for STDOUT.  But unlike UNIX, DOS doesn't have a scrollback bar.  Is there a way around this so that when I run a program in VC++, I can see more than 25 lines of output??
0
Comment
Question by:dpeng
1 Comment
 
LVL 2

Accepted Solution

by:
jzzhang earned 150 total points
ID: 1162142
You may consider to direct your output to a CEdit control. In your VC++ project, create a CEdit control with scroll bar in the CFormView. Each line of printf()is substituted by a code looks like this:

        m_pView->m_cEdit.SetSel(0x7FFF, 0x7FFF);
      sprintf(text, "your output string\r\n");
      m_pView->m_cEdit.ReplaceSel(text, FALSE);

m_pView is the pointer of your current view. m_cEdit is the variable of the CEdit control. USing SetSel(0x7FFF, 0x7FFF)to select the portion after the last character of the CEdit. Using ReplaceSel() to write the string to the CEdit. Do not forget to add "\r\n". Also encapsulate your UNIX program into a class. Since the CEdit control has scroll bar, you can see the whole content of your output.

Hope it will be help.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question