Udostępnij za pośrednictwem


CWinApp::AddDocTemplate

Wywołanie tej funkcji Członkowskich dodać szablon dokumentu do listy szablonów dostępnych dokumentów, które utrzymuje aplikacji.

void AddDocTemplate(
   CDocTemplate* pTemplate 
);

Parametry

  • pTemplate
    Wskaźnik do CDocTemplate do dodania.

Uwagi

Należy dodać szablony aplikacji wszystkich dokumentów przed wywołaniem RegisterShellFileTypes.

Przykład

   // The following code is produced by the Application Wizard when you
   // choose the MDI (multiple document interface) option.
    CMultiDocTemplate* pDocTemplate;
    pDocTemplate = new CMultiDocTemplate(IDR_MYTYPE,
        RUNTIME_CLASS(CMyDoc),
        RUNTIME_CLASS(CChildFrame), // custom MDI child frame
        RUNTIME_CLASS(CMyView));
    if (!pDocTemplate)
        return FALSE;
    AddDocTemplate(pDocTemplate);

Wymagania

Nagłówek: afxwin.h

Zobacz też

Informacje

Klasa CWinApp

Wykres hierarchii

CWinApp::RegisterShellFileTypes

Klasa CMultiDocTemplate

Klasa CSingleDocTemplate