Solved

CView or CWnd CreateView

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need to retreive data from .TFS file exported by DVR 8 196
ODBC Connection Logging, ADO.NET 6 64
centeredAverage challenge 8 163
canBalance challenge 34 81
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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