Solved

attaching CScrollView to CStatic in CDialog

Posted on 1997-05-27
3
576 Views
Last Modified: 2013-12-03
i am trying to attach CScrollView object to a CStatic object in a simple CDialog object in Visual C++ v5.0 through the MFC library at runtime.

if there's a better way to do this, i'm open to hearing it.

basically, what i need is an output dialog box that will handle potentially lots of lines of text and allow the user to scroll through it.  the user can't edit the text.  it's just there for output.  so, i thought of the following set up.

class CResultsDlg : public CDialog

this is the dialog box that holds the text and the OK button to close.  it's a simple modal dialog box with a horizontal scroll bar and a vertical scroll bar (do i need those or will the CScrollView handle this?) and a static text box.

class COutput : CScrollView

i used the MFC Class Wizard to create this class.  however, if i declare it in CResultsDlg header, the compiler chokes and says it can't access the protected constructor.  what good is the wizard if it won't let you construct the object you're trying to use?  so, that's my first problem.  that declaration looks like this:

       COutput m_outputBox;

and is in the Results.h header file.  this is choked on 'cause the constructors of MFC classes are protected.

finally, there's the CStatic control which is simply a CWnd object that i'm trying to attach to the CScrollView object.

so, that's what i'm trying to do.  does anyone know either a better way to go about doing this or have some code that does this or wants to give me some advise about going about this, i'd really appreciate it.

thanks,

scribs
0
Comment
Question by:scribbles
[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
  • 2
3 Comments
 

Author Comment

by:scribbles
ID: 1397677
Edited text of question
0
 
LVL 4

Accepted Solution

by:
AVaulin earned 50 total points
ID: 1397678
You can use EDIT control to display multilines text. Use READONLY attribute to disable text editting.
0
 

Author Comment

by:scribbles
ID: 1397679
well, if that's it, then wow, thanks.  i always find the hard way to do things and get all puzzled :)

scribs
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

726 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