Solved

VC++ MS-DOS Scroll-Back?

Posted on 1998-04-19
1
353 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

737 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