From: akafazov on
Hi,

I am writing a custom SampleGrabber filter for windows mobile 6. I had
a couple of issues with the base classes, as I linked to strmbase.lib
in Windows Mobile 6 SDK and the DECLARE_IUNKNOWN macro doesn't work
for me, so I had to override the IUnknown interface:

STDMETHODIMP QueryInterface(REFIID riid, void **ppv) {
if ( IID_ISampleGrabber == riid ) {
*ppv = (ISampleGrabber*)this;
m_cRef++;
return S_OK;
}
else if ( riid == IID_IAMovieSetup )
{
*ppv = (ISampleGrabber*)this;
m_cRef++;
return S_OK;
}
else if ( riid == IID_IBaseFilter )
{
*ppv = (ISampleGrabber*)this;
m_cRef++;
return S_OK;
}
else if ( riid == IID_IMediaFilter )
{
*ppv = (ISampleGrabber*)this;
m_cRef++;
return S_OK;
}
else
{
return CTransformFilter::NonDelegatingQueryInterface(riid,ppv);
}
};
STDMETHODIMP_(ULONG) AddRef() {
m_cRef++;
return S_OK;
};
STDMETHODIMP_(ULONG) Release() {
m_cRef--;
return S_OK;
};

After that I was able to register the filter and build the graph, but
then I get an exception in the IMediaControl::Run method:

Data Abort: Thread=966762cc Proc=80096d60 'TimedCamera.exe'
AKY=00001001 PC=02f5bf38(quartz.dll+0x00012f38)
RA=001b6c98(TimedCamera.exe+0x001a6c98) BVA=1a000029 FSR=00000407
Unhandled exception at 0x02f5bf38 in TimedCamera.exe: 0xC0000005:
Zugriffsverletzung beim Lesen an Position 0x00000029.


Do you have any idea on what the issue might be. I am not sure if I
have correctly set up the build environment. I have now installed
Platform Builder 5.0 and will try to link to the strmbase.lib there.

Thanks,
Angel