Solved

Creating a hidden window using CMultiDocTemplate

Posted on 2000-03-06
2
411 Views
Last Modified: 2013-11-20
I want to create a document without displaying a new view or frame window.

I am able to create a new document and view at the same time using CMultiDocTemplate.  

How can I create a hidden window (with a document and without flashing or changing the active view)?
0
Comment
Question by:PeterKen
[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 Comments
 
LVL 12

Accepted Solution

by:
migel earned 50 total points
ID: 2590753
Hmm
you can create document without view-frame by calling operator new.
but in this case you must provide public constructor for your document and also you must delete it manually (since MFC destroy doc when it`s frame has being destroyed).
Or you want create any docs based on the CMultiDocTemplate?
in this case you can use CreateNewDocument method of the CMultiDocTemplate

for example:
{
//look for needed template
CWinApp* pApp = AfxGetApp();
POSITION posTemplate = pApp->GetFirstDocTemplatePosition();
CDocTemplate* pTemplate = NULL;
while ((pTemplate = pApp-> GetNextDocTemplate( posTemplate) )!= NULL)
{
CDocument* pDocOpened = NULL;
if (pTemplate->MatchDocType(".docext", pDocOpened) != yesAttemptNative)
continue;
CDocument*  pDoc= pTemplate->CreateNewDocument();
}
}

here: ".docext" is extension of the document files you want to open. - see string  resource for document template
0
 

Author Comment

by:PeterKen
ID: 2592602
Thanks migel.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.

739 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