Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Access violation reading location 0x00000000. [Directshow][CF]

145 views
Skip to first unread message

jetonosmani

unread,
Jun 11, 2007, 3:10:13 PM6/11/07
to
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

jetonosmani

unread,
Jun 11, 2007, 3:13:04 PM6/11/07
to

The March Hare [MVP]

unread,
Jun 11, 2007, 3:19:40 PM6/11/07
to
On Mon, 11 Jun 2007 12:10:13 -0700, Jeton Osmani wrote:

> I get an access violation at this stage:
> pGraphBuilder->RenderFile(L"\\test.wmv", NULL);

What version of Windows do you have?

If it's not WinCE, have you tried specifying the drive letter? Example:

L"C:\\test.wmv"

--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution

Alessandro Angeli

unread,
Jun 11, 2007, 3:32:42 PM6/11/07
to
From: "Jeton Osmani"

> I get an access violation at this stage:
> pGraphBuilder->RenderFile(L"\\test.wmv", NULL);

Not just any access violation, but a null pointer exception.
What's the value of pGraphBuilder? Why don't you check the
HRESULTs of the calls?

--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm


DerMitDerMausKlickt

unread,
Jun 12, 2007, 10:09:32 AM6/12/07
to
Thanks first of all,

I'm using wm5 therefore the first suggestion will not work.
Secondly i checked the hresults they look strange.

Before:
hr: 0 {S_OK}
after:
hr: -2147220970

the pgraphbuilder/ifitlergraph/iuknown look before and after the same.

Rgds & many thks

DerMitDerMausKlickt

unread,
Jun 12, 2007, 10:12:41 AM6/12/07
to

The March Hare [MVP]

unread,
Jun 12, 2007, 10:25:07 AM6/12/07
to
On Tue, 12 Jun 2007 14:12:41 -0000, DerMitDerMausKlickt wrote:

> I'm using wm5 therefore the first suggestion will not work.
> Secondly i checked the hresults they look strange.
>
> Before:
> hr: 0 {S_OK}
> after:
> hr: -2147220970
>
> the pgraphbuilder/ifitlergraph/iuknown look before and after the same.

HRESULT: 0x80040216 (2147746326)
Name: VFW_E_NOT_FOUND
Description: An object or name was not found.
Severity code: Failed
Facility Code: FACILITY_ITF (4)
Error Code: 0x0216 (534)

Are you sure the \\test.wmv file exists? Is WM5 case sensitive?

DerMitDerMausKlickt

unread,
Jun 12, 2007, 7:34:50 PM6/12/07
to
I just rechecked the file is in each folder, no success no idea why as
said after that line the hr refers to a -21xxx number. Could it be
that my phone htc P4350/herald is not supporting this?

thks

Message has been deleted

DerMitDerMausKlickt

unread,
Jun 15, 2007, 12:27:46 PM6/15/07
to
I tried now with another device and receive at least more error
messages:

Maybe somebody can help, the hr says a share violation has occured.
I tried with wmv file and asf!!! Do i need to ren it in a seperate
thread?
------------------------------------------------------------------------------------------------------------------
Sending STREAM_BEGIN message from CompleteConnect()
Video-Thread Message : STREAM_BEGIN
AHI-ERROR : DecodeMmSys() FAILed in DecodeFileEx() -- sts = 0x4

AHI-ERROR : DecodeFileEx() FAILed in MPEGDecodeInit() -- sts = 0x4
AHI-ERROR: Initializations = 0x4

Video-Thread Message : STREAM_BEGIN(Reply given)
Sending STREAM_END message from CompleteConnect()
Video-Thread Message : STREAM_END
[HTCDisableDShowAudio] Success to disable DShow Audio

Video-Thread Message : STREAM_END(Reply given)Load module:
HTCDrmAPI.dll
Load module: HTCAsyncSrcFlt.dll
[CHTCAsyncFilter]CreateInstance() 1
[CAsyncOutputPin] CAsyncOutputPin()
[HTCDrmStream] HTCDrmStream()
[CHTCAsyncFilter]1 CHTCAsyncFilter()
Load module: audioparser.dll

Video-Thread Message : EXIT_THREAD
Video-Thread Message : EXIT_THREAD(Reply given)The thread 0x4294349a
has exited with code 0 (0x0).
[CHTCAsyncFilter]1 ~CHTCAsyncFilter()
[CAsyncOutputPin] ~CAsyncOutputPin()
------------------------------------------------------------------------------------------------------------------


sumanma...@gmail.com

unread,
Oct 24, 2013, 4:27:17 AM10/24/13
to
The Error due to access violation occurs when the filter name mentioned in the code does not match with the filter list in the graph edit or ffmpeg list.You should ensure that you have given the name of the filter correctly in your code

MS
IIT KGP
0 new messages