Original Post
Hello together
I''ve try out to read the codec''s from a mediafile. But i can''t
procedure GetFilter(ffile:string);
var hr :HResult;
Graph:IGraphBuilder;
x
WideChar;
Filter:IEnumFilters;
BFil :IBaseFilter;
cFetched:DWord;
FilterI:TFILTERINFO;
begin
CoInitialize(nil);
x:=new(PWideChar);
MultiByteToWideChar(CP_ACP,0,Pchar(ffile),-1,x,strlen(Pchar(FFile))+1);
hr:=CoCreateInstance(CLSID_FilterGraph,nil,CLSCTX_INPROC_SERVER,IID_IGraphBuilder,Graph);
if hr=0 then
begin
if Graph.RenderFile(x,nil)<>S_OK then
begin
Graph.EnumFilters(Filter); ___ here is the Problem
Filter.Reset; \|/
while Filter.Next(1,BFil,@cFetched)=0 do
begin
BFil.QueryFilterInfo(FilterI);
Form1.ListBox1.Items.Add(FilterI.achName);
end;
Filter:=nil;
end;
end;
Graph:=nil;
CoUnInitialize;
end;
The loop doesn''t run. He jump''s immediately to the end and i don''t know why.
Please help