Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

attaching CScrollView to CStatic in CDialog

Posted on 1997-05-27
3
Medium Priority
?
588 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 150 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

610 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