Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CView or CWnd CreateView

Posted on 1998-02-26
3
Medium Priority
?
1,436 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
ID: 1316585
There is no CWnd::CreateView() function. CFrameWnd and CSplitterWnd had CreateView() members, but CWnd certainly doesn't.

.B ekiM

0
 

Author Comment

by:jerzak
ID: 1316586
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 80 total points
ID: 1316587
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Screencast - Getting to Know the Pipeline

876 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