Horrid
Programmer
- May 20, 1999
- 373
I am writing an app in VB that needs to be able to scan through the available filters and find any TV or direct video feeds. Unforunatly all the DirectShow documentation is in C++ so I'm finding it rather difficult. As a result my varialbe names are a bit out of wack as many I have changed the type of as I went.
But here is what I am trying so far
Private m_objMediaControl As IMediaControl 'MediaControl Object
Private filterinfo2 As IRegFilterInfo
Private filterinfo As IFilterInfo
Private filtercollection As IAMCollection
Private pins As IPinInfo
Private unknown As IUnknownVB 'external typelib defines this
Private voidobject As VOID ' for use with iunknown
Private Sub Form_Load()
Set m_objMediaControl = New FilgraphManager
Set filtercollection = m_objMediaControl.RegFilterCollection
Dim i As Integer
For i = 0 To filtercollection.Count
' problem seems to start here
' how do I get info from the collection?
filtercollection.Item i, unknown
unknown.queryinterface IID?< where from, voidobject
Next i
End Sub
what I am trying to do is go through all the filters in the registy, find the TV type ones and add the required filters to the fileter graph. Now I could be doing this totally wrong and maybe I should be doing something with pins. One of my problems is that I have no idea how Iunknown functions, how do I know the IID for the queryinterface?
Any help appreciated, even if you just tell me I'm on the wrong track and try something new.
But here is what I am trying so far
Private m_objMediaControl As IMediaControl 'MediaControl Object
Private filterinfo2 As IRegFilterInfo
Private filterinfo As IFilterInfo
Private filtercollection As IAMCollection
Private pins As IPinInfo
Private unknown As IUnknownVB 'external typelib defines this
Private voidobject As VOID ' for use with iunknown
Private Sub Form_Load()
Set m_objMediaControl = New FilgraphManager
Set filtercollection = m_objMediaControl.RegFilterCollection
Dim i As Integer
For i = 0 To filtercollection.Count
' problem seems to start here
' how do I get info from the collection?
filtercollection.Item i, unknown
unknown.queryinterface IID?< where from, voidobject
Next i
End Sub
what I am trying to do is go through all the filters in the registy, find the TV type ones and add the required filters to the fileter graph. Now I could be doing this totally wrong and maybe I should be doing something with pins. One of my problems is that I have no idea how Iunknown functions, how do I know the IID for the queryinterface?
Any help appreciated, even if you just tell me I'm on the wrong track and try something new.