DirectX SDK

Custom Loading

[Visual Basic]

This topic pertains only to applications written in C++. DirectX for Visual Basic supports only loading of standard DirectMusic objects.

[C++]

Specialized applications might create their own object types that encapsulate data from a file or resource. It can be convenient to have the DirectMusic loader handle the loading of such objects. This is especially true if the custom object is referred to by other objects or contains references to other objects.

To implement a loading mechanism that takes advantage of the DirectMusic loader, take the following steps:

An application might need to manage file input itself—for example, if all objects are stored in a special compressed resource file. The application can create its own loader by creating an object that supports the IDirectMusicLoader interface, with the IDirectMusicLoader::GetObject method implemented. All other methods are optional. This implementation of the loader must also create its own stream object that has both the IStream and the IDirectMusicGetLoader interfaces.