- C# code
Type comtype = null; object comobj = null; comtype = Type.GetTypeFromCLSID( Clsid.FilterGraph ); if( comtype == null ) throw new NotSupportedException( "DirectX (8.1 or higher) not installed?" ); comobj = Activator.CreateInstance( comtype ); graphBuilder = (IGraphBuilder) comobj; comobj = null; int hr = graphBuilder.RenderFile( clipFile, null ); if( hr < 0 ) Marshal.ThrowExceptionForHR( hr ); .......后面代码就不写了........
如上代码,wince 5.0 ,我执行循环播放,比如播放完成后,我把上面的代码重新执行一次,更换clipFile的值;
在int hr = graphBuilder.RenderFile( clipFile, null );这里经常(不是每次都有错误)会出现hr=-2147220970错误,查找错误提示后得知:An object or name was not found. 0x80040216 但是我确认这个文件是有的。
------解决方案--------------------------------------------------------
是不是路径问题