mciSendString 播放视频文件 获取时间不正确
'载入视频
mciCommand = "open " & ShortPathName & " type MPEGVideo alias " & alias
mciCommand = mciCommand & " parent " & destPic.hwnd & " style child"
nReturn = mciSendString(mciCommand, 0&, 0, 0)
''''''''''''''获取时间
Public Function Duration(sAlias As String) As Long
Dim nReturn As Long, nLength As Long
Dim sLength As String * 64
If sAlias = "" Then
Duration = 0
Exit Function
End If
nReturn = mciSendString("Status " & sAlias & " length", sLength, 64, 0)
nLength = InStr(sLength, Chr$(0))
Duration = Val(Left$(sLength, nLength - 1))
End Function
问题来了,用这个获取到的时间不正确,用我自己的电脑获取的正确,换了一台电脑就不对了~~请高手帮忙
还有什么地方需要注意的吗?
视频 VB mciSendString
[解决办法]
看看我写的这个:http://blog.csdn.net/chenjl1031/article/details/1964909