CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    TTY window with MFC

    Is there a simple way to build a window for continuous text output (like a terminal window) ?


  2. #2
    Join Date
    May 1999
    Posts
    123

    Re: TTY window with MFC

    Probably the easiest way is to use a listbox control, and append lines to the bottom of the list box. Make sure the list box is NOT sorted. When you reach some maximum number of lines in the listbox, you'll probably want to start deleting the first line each time you add a new line, so it doesn't take up too much memory.


    The universe is a figment of its own imagination.

  3. #3
    Join Date
    May 1999
    Location
    Germany
    Posts
    12

    Re: TTY window with MFC

    Hi,
    I had the same problem and solved it pragmatically by using a CEditView derived class (I called it CLogView). Then I added a printf which finds the CLogView via a static member of CLogView.
    In InitInstance I added:
    // this is for the log view.
    m_pLogTemplate = new CMultiDocTemplate(
    IDR_LOGTYPE,
    RUNTIME_CLASS(CLogDoc),
    RUNTIME_CLASS(CMDIChildWnd), // standard MDI child frame
    RUNTIME_CLASS(CLogView));
    AddDocTemplate(m_pLogTemplate);

    Let me know if you need more details.

    Dieter Fauth :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured