For Programmers: Free Programming Magazines  


Home > Archive > Smartphone Developer Forum > April 2006 > VFW_E_NOT_FOUND error on RenderFile









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author VFW_E_NOT_FOUND error on RenderFile
Tony

2006-04-03, 10:04 pm

hi:
I run a basic sample on smartphone device to play a wma file, but get a
error....
Here is the code snippet:
---------------------------------------------------------------------------------------------------------------------------

IGraphBuilder *pGraphBuilder;
IMediaControl *pMediaControl;
HRESULT hr = CoInitialize(NULL);

if(FAILED(hr))
{
MessageBox(L"ERROR: failed to initialize COM library!!!");
return;
}

hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC,
IID_IGraphBuilder, (void **) &pGraphBuilder);
if(FAILED(hr))
{
MessageBox(L"ERROR: failed to create Filter Graph Manager
instance!!");
return;
}

pGraphBuilder->QueryInterface(IID_IMediaControl, (void **)
&pMediaControl);

hr = pGraphBuilder->RenderFile(L"\\test.wma", NULL);
if(SUCCEEDED(hr))
{
pMediaControl->Run();
MessageBox(L"click ok to end playback...");
}
else
MessageBox(L"ERROR: failed to run Filter Graph...");

pMediaControl->Release();
pGraphBuilder->Release();
CoUninitialize();
---------------------------------------------------------------------------------------------------------------------------
I get a 0x80040216 (VFW_E_NOT_FOUND) error on RenderFile. The
description of VFW_E_NOT_FOUND is "An object or name was not found".

Could someone provide a clue??

Best Regards.

Tony

2006-04-06, 7:05 pm

I still can't find the solution....

I put the test.wma in the same path as this exe file
Is anything wrong with the path?? I have no idea....

Anyone has experience of this?
Please give me some advice.

Thanks.

Sai

2006-04-06, 7:05 pm

I think your application is expecting the file to be present at the
root folder on device ( \ )
I dont think there is a concept of relative paths with CE. if you want
to place the file in the same folder as the exe then build the path to
the exe folder using
path = GetModuleFileName(...) and then <path>\\test.wma


-Sai

Tony

2006-04-09, 10:05 pm

I have used the absolute path, e.g.
hr = pGraphBuilder->RenderFile(L"\\Program Files\\test\\test.wma",
NULL);
BUT it doesn't work....

It's so weird.....Anything wrong??

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com