Discussion:
Access violation reading location 0x00000000. [Directshow][CF]
(too old to reply)
unknown
2007-06-11 19:10:13 UTC
Permalink
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
The March Hare [MVP]
2007-06-11 19:19:40 UTC
Permalink
Post by unknown
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
2007-06-11 19:32:42 UTC
Permalink
From: "Jeton Osmani"
Post by unknown
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
2007-06-12 14:09:32 UTC
Permalink
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
2007-06-12 14:12:41 UTC
Permalink
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
The March Hare [MVP]
2007-06-12 14:25:07 UTC
Permalink
Post by DerMitDerMausKlickt
I'm using wm5 therefore the first suggestion will not work.
Secondly i checked the hresults they look strange.
hr: 0 {S_OK}
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?
--
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
DerMitDerMausKlickt
2007-06-12 23:34:50 UTC
Permalink
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
The March Hare [MVP]
2007-06-13 00:01:04 UTC
Permalink
Post by DerMitDerMausKlickt
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?
I googled and it looks like your device supports WMV playback (but possibly
only certain forms of it, see your user manual).

It looks like the code specifies that it is in the root folder. Is this
folder read-only on your device?

Perhaps you have to change the folder specification in the code to match
where it is on your device.

Also, you may want to try alternative WMVs if the test.wmv is not supported
on your device.
--
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
DerMitDerMausKlickt
2007-06-15 16:27:46 UTC
Permalink
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()
------------------------------------------------------------------------------------------------------------------
s***@gmail.com
2013-10-24 08:27:17 UTC
Permalink
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

Loading...