Solved

CView or CWnd CreateView

Posted on 1998-02-26
3
1,284 Views
Last Modified: 2013-11-20
What is the difference between using the CView class and
creating a view using the CreateView class function in the CWnd class ?. Can they be used interchangeably ?. Can the CreateView be used in a splitter application ?. Can a CWnd derived control class be used in a splitter application ?.
0
Comment
Question by:jerzak
  • 2
3 Comments
 
LVL 11

Expert Comment

by:mikeblas
Comment Utility
There is no CWnd::CreateView() function. CFrameWnd and CSplitterWnd had CreateView() members, but CWnd certainly doesn't.

.B ekiM

0
 

Author Comment

by:jerzak
Comment Utility
Mike,
I stand corrected on the CreateView (I'm not an MFC expert ....
yet) Anyway lets go thru the question again making the substitute on CFrameWnd for CWnd (where applicable).


0
 
LVL 11

Accepted Solution

by:
mikeblas earned 20 total points
Comment Utility
Well, the difference between CreateView in CFrameWnd and CreateView in CSplitterWnd is simply support for splitter windows.

CreateView in CSplitterWnd knows that the view needs to be laid out inside the splitter. If there's other panes in the splitter, CSplitterWnd::CreateView() will shrink them to share space with the new view. CSplitterWnd's CreateView() implementation also assures that the view gets hooked up with the right CDocument object, since it will probably be associated with an existing document instead of a new one.

CreateView in CFrameWnd just creates a view. It expects that view to take up the whole client area of the view, and assures that the view doesn't have WS_EX_CLIENTEDGE because it would look stupid. CFrameWnd isn't as careful with the existing document setup because it will probably be called from the doc template as a _new_ document is being created.

.B ekiM

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

743 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

15 Experts available now in Live!

Get 1:1 Help Now