書上的源碼是: [cpp] #include <iostream> #include <dshow.h> using namespace std; int main() { cout<<"PlayerDemo"<<endl; IGraphBuilder * pGraph = NULL; IMediaControl * pControl = NULL; IMediaEvent * pEvent = NULL; HRESULT hr = CoInitialize(NULL); if (FAILED(hr)) { printf("ERROR - Could not initialize COM library"); return 0; } hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void**)&pGraph); if (FAILED(hr)) { printf("ERROR - Could not create the Filter Graph Manager."); return 0; } hr = pGraph->QueryInterface(IID_IMediaControl, (void**)&pControl); hr = pGraph->QueryInterface(IID_IMediaEvent, (void**)&pEvent); hr = pGraph->RenderFile(L"C:\\DXSDK\\Samples\\Media\\CLOCKTXT.avi", NULL); if (SUCCEEDED(hr)) { hr = pControl->Run(); if (SUCCEEDED(hr)) { long evCode; pEvent->WaitForCompletion(INFINITE, &evCode); } } pControl->Release(); pEvent->Release(); pGraph->Release(); CoUninitialize(); return 0; } linker->input 裡面包含Strmbasd.lib庫。