Microsoft DirectX 8.0 (C++)

IDirectXFile::RegisterTemplates

Registers custom templates.

HRESULT RegisterTemplates(
  LPVOID pvData,
  DWORD cbSize
);

Parameters

pvData
[in] Pointer to a buffer consisting of a Microsoft® DirectX® file in text or binary format that contains templates.
cbSize
[in] Size of the buffer pointed to by pvData, in bytes.

Return Values

If the method succeeds, the return value is DXFILE_OK.

If the method fails, the return value can be one of the following values.

DXFILEERR_BADFILEFLOATSIZE
DXFILEERR_BADFILETYPE
DXFILEERR_BADFILEVERSION
DXFILEERR_BADVALUE
DXFILEERR_PARSEERROR

Remarks

The following code fragment provides an example call to RegisterTemplates and example contents for the buffer to which pvData points.

TIDirectXFile * pDXFile;

char *szTemplates = "xof 0303txt 0032\
    template SimpleData { \
        <2b934580-9e9a-11cf-ab39-0020af71e433> \
        DWORD item1;DWORD item2;DWORD item3;} \
    template ArrayData { \
        <2b934581-9e9a-11cf-ab39-0020af71e433> \
        DWORD cItems; array DWORD aItem[2][cItems]; [...] } \
    template RestrictedData { \
        <2b934582-9e9a-11cf-ab39-0020af71e433> \
        DWORD item; [SimpleData]}";

hr = pDXFile->RegisterTemplates(szTemplates, strlen(szTemplates));

All templates must specify a name and a Universally Unique Identifier (UUID).

Requirements

  Header: Declared in Dxfile.h.
  Import Library: Use D3dxof.lib.