In VB to add a form, a ActiveMovie control that is added in the form HScroll play button and scroll bar, click the play button when playing video, a scroll bar shows progress,
Part of the statement:
Private Sub Command1_Click ()
ActiveMovie1. FileName="H: \ Temp Save \ video. Avi"
Call HScroll_Ctrl
End Sub
Private Sub Timer1_Timer ()
HScroll1. Value=https://bbs.csdn.net/topics/Int (ActiveMovie1. CurrentPosition)
Label2. Caption=HScroll1. Value & amp; "S/" & amp; Int (ActiveMovie1. Duration) & amp; "S"
End Sub
Private Sub HScroll_Ctrl ()
On the Error Resume Next
HScroll1. Max=ActiveMovie1. There is FLASH Duration 'put the total number of frames as the largest of the scroll bar range
Timer1.=500 'Interval Timer control the time Interval of 0.5 seconds
End Sub
Environment:
VB6.0 by use of Windows XP
Question:
After running the program, click the play button ActiveMovie control can normal play video, but not scroll scroll bar, click the play button again to normal (scroll bar to scroll schedule),
When HScroll_Ctrl "()" in the process of "On the Error Resume Next" after removed, run time display:
Real-time error '430'
Class does not support automation or does not support the desired interface
When debugging again, click the play button again to normal operation,
Can you tell me how to solve?
CodePudding user response:
Video to load is not so fast, immediately take ActiveMovie1 Duration,ActiveMovie any event, after loading or play at the beginning to call HScroll_Ctrl (),
Again: function named style is bad, the underline with reserved for events,
CodePudding user response:
Thank Tiger_Zhao teacher answer, not only for this problem, but also points out the specification problems, thanks again!The other teacher: On the BBS HScroll1. Max statements moved to Timer1_Timer inside of the first sentence, the front one more On the Error Resume Next to prevent Error,
- has been solved,
CodePudding user response: