Solved

CView or CWnd CreateView

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Title # Comments Views Activity
Add content to output file 4 67
Generic progress indicator 6 117
Process filename extension 3 194
sameEnds challenge 3 179
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

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