?
Solved

attaching CScrollView to CStatic in CDialog

Posted on 1997-05-27
3
Medium Priority
?
580 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

762 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