unknown
2007-06-11 19:10:13 UTC
Hello everbody,
I have a simple question i copy/paste this code below one to one from the Microsoft page and its
not working. I tried everything from a to z and
cant get this dummy thing going.
I get an access violation at this stage:
pGraphBuilder->RenderFile(L"\\test.wmv", NULL);
Any help would very much appreciate
Rgds & thks
#include <dshow.h>
void __cdecl main(void)
{
IGraphBuilder *pGraphBuilder;
IMediaControl *pMediaControl;
CoInitialize(NULL);
CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC,
IID_IGraphBuilder, (void **)&pGraphBuilder);
pGraphBuilder->QueryInterface(IID_IMediaControl,
(void **)&pMediaControl);
pGraphBuilder->RenderFile(L"\\test.wmv", NULL);
pMediaControl->Run();
MessageBox(NULL, "Click OK to end playback.", "DirectShow", MB_OK);
pMediaControl->Release();
pGraphBuilder->Release();
CoUninitialize();
}
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
I have a simple question i copy/paste this code below one to one from the Microsoft page and its
not working. I tried everything from a to z and
cant get this dummy thing going.
I get an access violation at this stage:
pGraphBuilder->RenderFile(L"\\test.wmv", NULL);
Any help would very much appreciate
Rgds & thks
#include <dshow.h>
void __cdecl main(void)
{
IGraphBuilder *pGraphBuilder;
IMediaControl *pMediaControl;
CoInitialize(NULL);
CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC,
IID_IGraphBuilder, (void **)&pGraphBuilder);
pGraphBuilder->QueryInterface(IID_IMediaControl,
(void **)&pMediaControl);
pGraphBuilder->RenderFile(L"\\test.wmv", NULL);
pMediaControl->Run();
MessageBox(NULL, "Click OK to end playback.", "DirectShow", MB_OK);
pMediaControl->Release();
pGraphBuilder->Release();
CoUninitialize();
}
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com