Solved

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

Posted on 2001-08-08
3
248 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
ID: 6365032
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
ID: 6851048
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
ID: 6874504
Per recommendation comment force/accepted by

Netminder
Community Support Moderator
Experts Exchange
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Create string splitting user defined function in C++ 23 304
How to split this in C++ 4 103
Best book to learn C++ 4 79
passing data from one form to another form in c++ 27 80
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

803 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