Solved

VC++ MS-DOS Scroll-Back?

Posted on 1998-04-19
1
330 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
Comment Utility
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 run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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 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.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now