CDocument::GetDocTemplate
문서 서식 파일에이 문서 형식에 대 한 포인터를 가져오려면이 함수를 호출 합니다.
CDocTemplate* GetDocTemplate( ) const;
반환 값
이 문서 형식에 문서 서식 파일에 대 한 포인터 또는 NULL 문서에 문서 서식 파일에 관리 되는 경우.
예제
// 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;
요구 사항
헤더: afxwin.h