Solved

attaching CScrollView to CStatic in CDialog

Posted on 1997-05-27
3
572 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
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

840 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