Opening the Movie Player

The following code fragment shows how an application might open a Movie Player instance and save the resulting movie ID. This code might be called in response to the WM_CREATE message sent to the main window.

// Open a Movie Player instance

if((idMovie = mmpOpen(hWnd, NULL)) == NULL)
{
    PrintError(idMovie, "Closing MMPLAY.");
    return FALSE;
}

If mmpOpen fails, the PrintError function calls mmpError to retrieve error information. Because the movie ID is NULL, mmpError retrieves the last Movie Player error.