Ok, so this web page shows an ABSOLUTE BARE MINIMUM piece of code in this tutorial for how to play an AVI file into a PictureBox control in VB6 with literally under 10 lines of code.
http://www.devx.com/vb2themax/Tip/18386
Here's the code they showed:
The upper segment of code is supposed to go into the the declarations part of your form. The below segment is supposed to go in a function such as the Click event of a command button.
After putting in a picturebox called "Pic" creating the needed Dims for the variables like "FileName" and "RetVal", and running the program, and clicking on the command button. NOTHING HAPPENS! Is there something wrong with this code in their tutorial? Or is it a bug in how the version of the API dll file "winmm" on my OS (Windows 7, Home Premium, x64) is handling handling it? Was this function only designed to work in Windows XP?
Can someone else try the code in the tutorial and see if it works for them. It keeps simply not working for me. And the return value is always error code 259, which according to the MS website means MCIERR_UNRECOGNIZED_KEYWORD
Please can someone else try this, and if it doesn't work, can someone recommend a "bare bones" piece of code that WILL work on my OS?
UPDATE:
Ok I fixed the error, so now it gives a return code of 0, which means no error.
But the playing which should be immediate after correctly loading the file (at least based on what I understand of that tutorial), STILL NEVER HAPPENS! The PictureBox control REMAINS BLANK! No video plays into the PictureBox control.
http://www.devx.com/vb2themax/Tip/18386
Here's the code they showed:
Code:
Declare Function mciSendString Lib "winmm" Alias "mciSendStringA" (ByVal _
lpstrCommand As String, ByVal lpstrReturnString As String, _
ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Const WS_CHILD = &H40000000
CommandString = "Open " + FileName + " type AVIVideo alias AVIFile parent " & _
CStr(Pic.hWnd) & " style " & CStr(WS_CHILD)
RetVal = mciSendString(CommandString, vbNullString, 0, 0)
After putting in a picturebox called "Pic" creating the needed Dims for the variables like "FileName" and "RetVal", and running the program, and clicking on the command button. NOTHING HAPPENS! Is there something wrong with this code in their tutorial? Or is it a bug in how the version of the API dll file "winmm" on my OS (Windows 7, Home Premium, x64) is handling handling it? Was this function only designed to work in Windows XP?
Can someone else try the code in the tutorial and see if it works for them. It keeps simply not working for me. And the return value is always error code 259, which according to the MS website means MCIERR_UNRECOGNIZED_KEYWORD
Please can someone else try this, and if it doesn't work, can someone recommend a "bare bones" piece of code that WILL work on my OS?
UPDATE:
Ok I fixed the error, so now it gives a return code of 0, which means no error.
But the playing which should be immediate after correctly loading the file (at least based on what I understand of that tutorial), STILL NEVER HAPPENS! The PictureBox control REMAINS BLANK! No video plays into the PictureBox control.