Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

The following sample code plays a file. This example is a console application, so set the build target accordingly.

Note:
To make the following code example easier to read, error checking is not included. Do not use this code example in a release configuration unless it you have modified it to include secure error handling.
Copy Code
#include <streams.h>

void __cdecl main(void)
{
	IGraphBuilder *pGraph;
	IMediaControl *pMediaControl;
	CoInitialize(NULL);

	// Create the filter graph manager.
	CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC, 
						IID_IGraphBuilder, (void **)&pGraph);
	pGraph->QueryInterface(IID_IMediaControl, (void
**)&pMediaControl);

	// Build the graph. (IMPORTANT: Change string to a file on your
system.)
	pGraph->RenderFile(L"\\Hello_World.avi", NULL);

	// Run the graph.
	pMediaControl->Run();

	// Block until the user clicks the OK button. 
	// The filter graph runs on a separate thread.
	MessageBox(NULL, "Click me to end playback.", "DirectShow",
MB_OK);

	// Clean up.
	pMediaControl->Release();
	pGraph->Release();
	CoUninitialize();
}
500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@systemmanager.forsenergy.ru to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.