Solved

attaching CScrollView to CStatic in CDialog

Posted on 1997-05-27
3
569 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
Comment Utility
Edited text of question
0
 
LVL 4

Accepted Solution

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

Author Comment

by:scribbles
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now