a prb. related to DirectShow using VC++
hi, I've copied some code (that plays .avi file) from DirectX SDK and can't run it. There is a metheod CoCreateInstance() that accepts a parameter CLSID_FilterGraph, and my compiler says, "Unresolved External". Along with the above mentioned, there are other externals
what should I do ? ? ? ?
the prog. code
well, I think I should place the code here, here it is
IGraphBuilder *pGraph = NULL;
IMediaControl *pControl = NULL;
IMediaEvent *pEvent = NULL;
// Initialize the COM library.
HRESULT hr = CoInitialize(NULL);
printf("ERROR - Could not initialize COM library");
// Create the filter graph manager and query for interfaces.
hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
IID_IGraphBuilder, (void **)&pGraph);
printf("ERROR - Could not create the Filter Graph Manager.");
hr = pGraph->QueryInterface(IID_IMediaControl, (void **)&pControl);
hr = pGraph->QueryInterface(IID_IMediaEvent, (void **)&pEvent);
// Build the graph. IMPORTANT: Change this string to a file on your system.
hr = pGraph->RenderFile(L"C:\\Example.avi", NULL);
// Run the graph.
hr = pControl->Run();
// Wait for completion.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)