Solved

VC++ MS-DOS Scroll-Back?

Posted on 1998-04-19
1
342 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 50 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

776 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