Solved

Creating a hidden window using CMultiDocTemplate

Posted on 2000-03-06
2
398 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
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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 …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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 explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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

19 Experts available now in Live!

Get 1:1 Help Now