
i
i
i
i
i
i
i
i
15.3. A Movie Player 395
In any DirectShow application, there are a couple of essential function
calls required so that it can use the COM:
CoInitialize(NULL); // tell Windows we use COM
...
...
CoUninitialize(); // tell Windows we have finished with COM
The DirectShow FilterGraph is created when a specific movie is opened
for presentation. We need pointers to the graph builder (IGraphBuilder
*
pGB;
) interface and the media control interface (IMediaControl
*
pMC;),
which allows us to play the movie, stop it or pause it. All the actions in the
program are tied to menu commands calling the functions in Listing 15.2.
The four functions in this listing ...