Hi All,
Could anyone help me with this, I am developing an application which is using "Hauppauge WinTV-HVR 900 USB Stick" with "Microsoft TV Technology" MS Video Control with Microsoft Tuner 1.0 Type Library, in order to capture TV from analog antenna and display it. What's happened is I get an error message that says:
"Run-time error '-2147220906 (80040256)': Method 'Run' of object 'IMSVidCtl' failed"
everytime I try to run the code.
I am using Microsoft Windows XP SP3 with "Hauppauge WinTV-HVR 900 USB Stick".
This is the code:
Please could anyone address this problem or have a work arround; and I will appreciate it?
Thanks in advance.
Best regards,
A
Could anyone help me with this, I am developing an application which is using "Hauppauge WinTV-HVR 900 USB Stick" with "Microsoft TV Technology" MS Video Control with Microsoft Tuner 1.0 Type Library, in order to capture TV from analog antenna and display it. What's happened is I get an error message that says:
"Run-time error '-2147220906 (80040256)': Method 'Run' of object 'IMSVidCtl' failed"
everytime I try to run the code.
I am using Microsoft Windows XP SP3 with "Hauppauge WinTV-HVR 900 USB Stick".
This is the code:
Code:
Dim objTSContainer As New SystemTuningSpaces
Dim objTuneRequest As IChannelTuneRequest
Dim objTuneSpace As ITuningSpace
Dim objAnalogTuneSpace As New AnalogTVTuningSpace
Private Sub Form_Load()
For Each objTuneSpace In objTSContainer
If objTuneSpace.UniqueName = "MyTV" Then
objTSContainer.Remove "MyTV"
End If
Next
objAnalogTuneSpace.CountryCode = 44
objAnalogTuneSpace.UniqueName = "MyTV"
objAnalogTuneSpace.FriendlyName = "My Television"
objAnalogTuneSpace.MaxChannel = 70
objAnalogTuneSpace.MinChannel = 1
objAnalogTuneSpace.NetworkType = "{a799a800-a46d-11d0-a18c-00a02401dcd4}"
objAnalogTuneSpace.InputType = TunerInputAntenna
Set objTuneSpace = objAnalogTuneSpace
objTSContainer.Add objAnalogTuneSpace
Set objTuneRequest = objTSContainer("MyTV").CreateTuneRequest
intChannel = 23
objTuneRequest.Channel = intChannel
MSVidCtl_Sink.MaintainAspectRatio = True
MSVidCtl_Sink.View objTuneRequest
ENC_CLSID = "{BB530C63-D9DF-4B49-9439-63453962E598}"
Dim MyFeatures As New MSVidFeatures
For Each feature In MSVidCtl_Sink.FeaturesAvailable
If (feature.ClassID = ENC_CLSID) Then
MyFeatures.Add feature
Label1.Caption = "Found encoder :-)"
Else
Label1.Caption = "No encoder was found :-("
End If
Next
MSVidCtl_Sink.FeaturesActive = MyFeatures
GUID_NULL = "{00000000-0000-0000-0000-000000000000}"
SINK_CLSID = "{9E77AAC4-35E5-42A1-BDC2-8F3FF399847C}"
Dim MyOutputs As New MSVidOutputDevices
Dim objStreamBufferSink
For Each output In MSVidCtl_Sink.OutputsAvailable(GUID_NULL)
If output.ClassID = SINK_CLSID Then
MyOutputs.Add output
Set objStreamBufferSink = output
End If
Next
MSVidCtl_Sink.OutputsActive = MyOutputs
strFilename = "C:\Example.wmv"
objStreamBufferSink.SinkName = strFilename
MSVidCtl_Sink.DisableVideo
MSVidCtl_Sink.DisableAudio
MSVidCtl_Sink.Run
DVR_CLSID = "{AD8E510D-217F-409B-8076-29C5E73B98E8}"
Dim objStreamBufferSource
For Each objinput In MSVidCtl_Src.InputsAvailable(GUID_NULL)
If objinput.ClassID = DVR_CLSID Then
MSVidCtl_Src.InputActive = objinput
Set objStreamBufferSource = objinput
End If
Next
objStreamBufferSource.FileName = strFilename
MSVidCtl_Src.Run
End Sub
Thanks in advance.
Best regards,
A