Freigeben über


CDocument::GetDocTemplate

Rufen Sie diese Funktion auf, um einen Zeiger auf die Normal-Vorlage für diesen Dokumenttyp abzurufen.

CDocTemplate* GetDocTemplate( ) const;

Rückgabewert

Ein Zeiger auf die Normal-Vorlage für diesen Dokumenttyp oder NULL, wenn das Dokument nicht durch eine Normal-Vorlage verwaltet wird.

Beispiel

// This example accesses the doc template object to construct 
// a default document name such as SHEET.XLS, where "sheet" 
// is the base document name and ".xls" is the file extension
// for the document type.
CString strDefaultDocName, strBaseName, strExt;
CDocTemplate* pDocTemplate = GetDocTemplate();
if (!pDocTemplate->GetDocString(strBaseName, CDocTemplate::docName)
   || !pDocTemplate->GetDocString(strExt, CDocTemplate::filterExt))
{
   AfxThrowUserException(); // These doc template strings will 
      // be available if you created the application using AppWizard 
      // and specified the file extension as an option for 
      // the document class produced by AppWizard.
}
strDefaultDocName = strBaseName + strExt;

Anforderungen

Header: afxwin.h

Siehe auch

Referenz

CDocument-Klasse

Hierarchiediagramm

CDocTemplate-Klasse