Registering the Command Tables with MCI

The final checklist item lets the MCI parser know that you have a custom command table. Do this by making the following call in your driver's DRV_LOAD message handler:

wTableEntry = mciLoadCommandResource (hInstance, "pioneer", 0);
 

This example loads the resource named "pioneer," registers it with MCI, and returns a handle to that table.

If you have created a custom command table, your device driver must free the table when your device driver terminates. To free the table, include the following call in your device driver's DRV_FREE message handler:

fResult = mciFreeCommandResource (wTableEntry);
 

Use the table index number returned from mciLoadCommandResource as the argument to this function. This function returns TRUE if the table index number is valid.