次の方法で共有


ピン接続情報の表示

フィルタ オブジェクトの IFilterInfo.Pins プロパティからアクセス可能なコレクションのピン オブジェクトを取得した後、接続およびその他の情報を一覧表示できる。

  Dim strTemp As String 
  On Error Resume Next 
  Dim objPin As IPinInfo 
  For Each objPin In g_objSelFilter.Pins 
    If objPin.Name = listPins.Text Then ' リスト ボックスで選択したか ? 
      Set g_objSelPin = objPin  'はいの場合は、すべての情報を取得する 
      strTemp = ""  ' 既存の表示されているピン情報をクリアする 
      Dim objPinOther As IPinInfo 
      Set objPinOther = objPin.ConnectedTo 
      If Err.Number = 0 Then  ' はいの場合、接続が存在する 
        strTemp = "Connected to pin: " + objPinOther.Name + " " 
        Dim objPeer As IFilterInfo 
        Set objPeer = objPinOther.FilterInfo 
        strTemp = strTemp + " on filter: " + objPeer.Name + " " 
        Dim objMTI As IMediaTypeInfo 
        Set objMTI = objPin.ConnectionMediaType 
        strTemp = strTemp + vbCrLf + "Media Type: " + objMTI.Type 
      End If 
      If objPin.Direction = 0 Then 
        strTemp = strTemp + " " + vbCrLf + "Direction: Input" 
      Else 
        strTemp = strTemp + " " + vbCrLf + "Direction: Output" 
      End If 
    txtPinInfo.Text = strTemp 
    End If 
  Next objPin