Solved

VC++ MS-DOS Scroll-Back?

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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…
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 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.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

830 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