Solved

Creating a hidden window using CMultiDocTemplate

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how do i create updater to My Activex application? 3 101
Tab names are off by one 5 54
sumHeights  challenge 17 79
Problem to event 3 112
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: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.

762 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