Solved

How to derive a new class with CDocTemplate as the base class

Posted on 2001-08-08
3
244 Views
Last Modified: 2006-11-17
I need to derive a new class from CDocTemplate, so that i can override the CreateNewFrame function. Any insights would be helpful.

Thanks
Ramesh
0
Comment
Question by:brames_2000
3 Comments
 
LVL 30

Accepted Solution

by:
SteveGTR earned 100 total points
Comment Utility
I would create a new document template class that is derived from CSingleDocTemplate or CMultiDocTemplate. Override the CreateNewFrame() function doing what you need to do. Finally, in your application's InitInstance create instances of your new class for each document (code assumes MDI interface):

m_pMyDocTemplate = new CMyDocTemplate(
  IDR_MYDOC,
  RUNTIME_CLASS(CMyDoc),
  RUNTIME_CLASS(CMDIChildWnd),
  RUNTIME_CLASS(CMyView));
AddDocTemplate(m_pMyDocTemplate);

Good Luck,
Steve
0
 
LVL 11

Expert Comment

by:griessh
Comment Utility
I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. Unless there is objection or further activity,  I will suggest to accept "SteveGTR" comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points.
The link to the Community Support area is: http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 5

Expert Comment

by:Netminder
Comment Utility
Per recommendation comment force/accepted by

Netminder
Community Support Moderator
Experts Exchange
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

744 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

18 Experts available now in Live!

Get 1:1 Help Now