| Microsoft DirectX 8.1 (C++) |
Registers custom templates.
HRESULT RegisterTemplates( LPVOID pvData, DWORD cbSize );
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 |
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).
Header: Declared in Dxfile.h.
Import Library: Use D3dxof.lib.