obviously you need an animation control on your form.
The big advantage of using it this way is you don't need to worry about redistributing your app AND your avi-file, because it's included in the executable.
There's a file needed to remove the temporary file it's called _DelTemp.exe and is attached to this post.
BTW: Many thanks to Kenneth Ives who came up with this code
Last edited by mvrp350; Aug 22nd, 2001 at 03:12 AM.
Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal _
hwndCallback As Long) As Long
Private Sub Command1_Click()
' U can also use Form1.hwnd instead of Picture1.hwnd
Last$ = Picture1.hWnd & " Style " & &H40000000
ToDo$ = "open C:\Myavi.avi Type avivideo Alias video parent " & Last$
x% = mciSendString(ToDo$, 0&, 0, 0)
x% = mciSendString("put video window at 0 0 210 210", 0&, 0, 0)
x% = mciSendString("play video wait", 0&, 0, 0)
x% = mciSendString("close video", 0&, 0, 0)
End Sub
Private Sub Form_Unload(Cancel As Integer)
x% = mciSendString("close video", 0&, 0, 0)
End Sub
<If you attempt to load an .avi file that includes sound data or that is in a format not supported by the control, an error (error 35752) is returned.>
Soo! If you got a file with sounds you can´t use SjR´s code..
I tried using SJR's code for the animation control. I got error '53' - File not found. I know the file is there. Anyone have any suggestions on why it wouldn't be able to find the file?
To Seek is to start on the never ending road to wisdom. To fail to seek, the path to death.
The code is simple and straight-forward since this is more of a test than anything else.
Option Explicit
Dim FNames as String
Private Sub Command1_Click()
FNames = App.Path & "\Growing Mountains"
Form1.Animation1.Open FNames
Form1.Animation1.Play
End Sub
To Seek is to start on the never ending road to wisdom. To fail to seek, the path to death.
Adding .avi seems to have handled the problem. But apparently, when Poser creates an AVI there is an assumed audio component. So the animation control gives me the '35752' error that Libero mentioned.
I tried the MMControl that Libero talks about at the beginning of this post... But while it apparently runs (no errors) I also don't see any video.
To Seek is to start on the never ending road to wisdom. To fail to seek, the path to death.