A
anonymous
I recently purchased a new computer and with this started having an issue
with previously written software which works fine on XP suddenly crashing
when I close on Vista. Inside the dispose event for the class the first
think I do is stop the running graph and tear down existing filters. I am
receiving a "System.AccessViolationException" when I call the
lpMediaControl->Stop();. Just to make sure I wasnt missing anything I added
the Pause() and sleep before both of which succeed. Once it runs the stop
on the media control I get the error. Any ideas on what I might check?
IEnumFilters *lpEnumFilters;
IBaseFilter *lpBaseFilter;
ULONG lcFetched;
HRESULT hr = NOERROR;
IMediaControl *lpMediaControl = NULL;
if (gpGraphBuilder->QueryInterface(IID_IMediaControl, (void
**)&lpMediaControl) == S_OK && lpMediaControl)
{
OAFilterState lfilterState = NULL;
if(lpMediaControl->GetState(1000, &lfilterState) == S_OK && lfilterState)
if(lfilterState == State_Running)
{
hr = lpMediaControl->Pause();
System::Threading::Thread::Sleep(1000);
hr = lpMediaControl->Stop();
}
SAFE_RELEASE(lpMediaControl);
}
with previously written software which works fine on XP suddenly crashing
when I close on Vista. Inside the dispose event for the class the first
think I do is stop the running graph and tear down existing filters. I am
receiving a "System.AccessViolationException" when I call the
lpMediaControl->Stop();. Just to make sure I wasnt missing anything I added
the Pause() and sleep before both of which succeed. Once it runs the stop
on the media control I get the error. Any ideas on what I might check?
IEnumFilters *lpEnumFilters;
IBaseFilter *lpBaseFilter;
ULONG lcFetched;
HRESULT hr = NOERROR;
IMediaControl *lpMediaControl = NULL;
if (gpGraphBuilder->QueryInterface(IID_IMediaControl, (void
**)&lpMediaControl) == S_OK && lpMediaControl)
{
OAFilterState lfilterState = NULL;
if(lpMediaControl->GetState(1000, &lfilterState) == S_OK && lfilterState)
if(lfilterState == State_Running)
{
hr = lpMediaControl->Pause();
System::Threading::Thread::Sleep(1000);
hr = lpMediaControl->Stop();
}
SAFE_RELEASE(lpMediaControl);
}