Share via


CCustomAppWiz::LoadTemplate

OverviewsHow Do IDetails

Feature Only in Professional and Enterprise Editions   Creating a Custom AppWizard is supported only in Visual C++ Professional and Enterprise Editions. For more information, see .

virtual LPCTSTR LoadTemplate( LPCTSTR lpszTemplateName**, DWORD&** rdwSize**, HINSTANCE** hInstance = NULL );

Return Value

A pointer to the loaded custom resource template for use by CCustomAppWiz::CopyTemplate or CCustomAppWiz::ProcessTemplate.

Parameters

lpszTemplateName

A pointer to a string that contains the name (such as “NEWPROJ.INF” or “RESOURCE.H”) of a custom resource template. The custom resource has a type of “TEMPLATE”.

rdwSize

The size of the custom resource template is returned in this parameter. LoadTemplate provides this value for use by CCustomAppWiz::CopyTemplate and CCustomAppWiz::ProcessTemplate.

hInstance

A pointer that can either be NULL or be the handle of a Win32 module (a DLL or executable file) that you specify. In either case, hInstance informs LoadTemplate where it can find the custom resource template named by lpszTemplateName.

Remarks

After the user clicks OK in the custom AppWizard’s New Project Information dialog box, LoadTemplate finds, locks, and loads into memory the custom resource of type “TEMPLATE” that is named by lpszTemplateName.

If hInstance is NULL, the base-class implementation of LoadTemplate first looks in your custom AppWizard’s DLL for the custom resource template named by lpszTemplateName, and then, if the template is not there, among the MFC AppWizard’s custom resource templates. If hInstance is not NULL, the base-class implementation of LoadTemplate looks in the Win32 module hInstance.

You can override LoadTemplate to load templates from sources other than your custom AppWizard’s DLL or the MFC AppWizard DLLs. For more information on this process, see the implementation of LoadTemplate in the sample code for CUSTMWZ.AWX in the Microsoft Visual Studio\Common\msdev98\bin\ide directory.

See Also   CCustomAppWiz Overview, Class Members, CCustomAppWiz::CopyTemplate, CCustomAppWiz::ProcessTemplate, CCustomAppWiz::PostProcessTemplate, Understanding Custom Resource Templates, Understanding Text Templates