vb 实时错误53
这是我的一段代码,主要用来将AVI文件转换为MPG文件,但是运行时,我能够生成AVI文件,但是一但点击生成MPG文件,就会出现“ 实时错误53”。这是转MPG文件的代码
'生成MPG
Private Sub Command12_Click()
Dim Mpgest, Mpger, TheMovie As String
SetTopMostWindow Me.hWnd, False
'm2apx3g.exe -b PoppingAssCherry1-7.mpg -f -o7 output.avi
'avi2mpg1 [-options] inputfile.avi [outputfile.mpg]
Dim RetVal
TheMovie = App.Path & "\MyAVI.avi"
Mpger = App.Path & "\MyMPEG1.mpg"
'Mpgest = App.Path & "\m2apx3g.exe -b " & TheMovie & " -f -o7 " & Mpger & ".avi"
Mpgest = App.Path & "\avi2mpg1.exe -n -f1 " & TheMovie & " " & Mpger
RetVal = Shell(Mpgest, 1) '这里出现“文件未找到”的错误
End Sub
Private Sub Command13_Click() '播放MPG
SeeFlag = "mpg"
Load Form1
Form1.Show
End Sub
Private Sub Command2_Click() '生成AVI文件
Dim i As Long
Load fMain
fMain.Show
File1.Refresh
For i = 0 To File1.ListCount - 1
fMain.lstDIBList.AddItem App.Path & "\Images\" & File1.List(i)
Next
fMain.cmdWriteAVI_Click
Unload fMain
Set fMain = Nothing
End Sub
Private Sub Command2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Unload fMain
Set fMain = Nothing
End Sub
Private Sub Command2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Unload fMain
Set fMain = Nothing
End Sub
Private Sub Command3_Click() '生成GIF
Dim RetVal
RetVal = Shell(App.Path & "\AVItoGIF.exe MyAVI.avi", 1) '文件未找到错误
End Sub
///////////////////////////////////
这是生成AVI文件的代码
Private Sub Command2_Click() '生成AVI文件
Dim i As Long
Load fMain
fMain.Show
File1.Refresh
For i = 0 To File1.ListCount - 1
fMain.lstDIBList.AddItem App.Path & "\Images\" & File1.List(i)
Next
fMain.cmdWriteAVI_Click
Unload fMain
Set fMain = Nothing
End Sub
////////////////////////////////////
这是由AVI转GIF的代码(同时也是会出现“实时错误53,文件未找到”)
Private Sub Command3_Click() '生成GIF
Dim RetVal
RetVal = Shell(App.Path & "\AVItoGIF.exe MyAVI.avi", 1) '文件未找到错误
End Sub
希望大家能帮我解决这个问题
[解决办法]
换成绝对路径试试!你那个.exe 放在哪儿啦?
[解决办法]
debug 看一下App.Path & "\AVItoGIF.exe MyAVI.avi“是不是你想执行的目录,下面有没有文件啊!
没有理由调不起来。