Microsoft KB Archive/141003

= INFO: m_templateList Is No Longer Accessible in Visual C++ 4.0 =

Article ID: 141003

Article Last Modified on 11/18/2003

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 4.0 Professional Edition

 Microsoft Visual C++ 5.0 Learning Edition 

-



This article was previously published under Q141003



SUMMARY
In versions of Visual C++ older than 4.0, m_templateList was a public member of CWinApp. Starting with Visual C++ 4.0 (MFC 4.0) m_templateList is no longer accessible. m_templateList is a CPtrList object that contains a list of pointers to an application's document templates (CDocTemplate). CWinApp now provides public member functions for accessing the document templates CWinApp::GetFirstDocTemplatePosition and CWinApp::GetNextDocTemplate. You can use these functions to iterate through the list of CDocTemplate objects.



MORE INFORMATION
m_templateList is now a protected member of CDocManager, which is in turn a public member of CWinApp.

Sample Code
void CMyApp::DocTemplatesLoop {    // this section iterates through all document templates POSITION pos = GetFirstDocTemplatePosition; while (pos) {         CDocTemplate* pTemplate = GetNextDocTemplate(pos); // use pTemplate } }

Additional query words: kbinf 4.00

Keywords: kbinfo kbnoupdate kbdocview kbcode KB141003

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.