![]() |
![]() |
![]() |
XFileManager.RegisterTemplates Method |
Language: |
Registers custom templates.
Visual Basic Public Sub RegisterTemplates( _
ByVal data() As Byte _
)C# public void RegisterTemplates(
byte[] data
);C++ public:
void RegisterTemplates(
array<unsigned char>^ data
);JScript public function RegisterTemplates(
data : byte[]
);
data System.Byte[]
Array of Bytevalues that contain the templates.
The data parameter takes either a buffer that holds a compiled binary XFile, or a string that defines an XFile template, converted into an array of bytes. To convert a string into a byte array, use the GetBytes function, as in the following example, using stringVar as the string:
byte[] stringData = System.Text.Encoding.ASCII.GetBytes(stringVar);The object should be disposed immediately when it is no longer needed.
Exceptions
GraphicsException
- If a floating-point size is invalid, the GraphicsException.ErrorCode member contains the XFileErrorCodes.BadFileFloatSize enumerated value.
- If the file is not an XFile (.x file), GraphicsException.ErrorCode contains the XFileErrorCodes.BadFileType enumerated value.
- If the file version is not valid, GraphicsException.ErrorCode contains the XFileErrorCodes.BadFileVersion enumerated value.
- If a parameter is invalid, GraphicsException.ErrorCode contains the XFileErrorCodes.BadValue enumerated value.
- If the file could not be parsed, GraphicsException.ErrorCode contains the XFileErrorCodes.ParseError enumerated value.
Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center