Solved

CView or CWnd CreateView

Posted on 1998-02-26
3
1,355 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
[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
 
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 20 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
deburging in oracle form 12 119
wait notify demo infinite loop 3 148
NotAlone Challenge 20 92
wordmultiple challenge 12 169
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

732 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