Step 1: Initializing COM

Before making any calls to DirectMusic, you have to initialize COM as follows:

if (FAILED(CoInitialize(NULL)))
{
    // Terminate the application.
}   // Else full speed ahead!