Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
To VP or not VB that is the question
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00592024
Message ID:
00592033
Views:
16
See corrections in bold below.

>What am I doing wrong here? I cannot load the DLL
>
>
>#if .f.
>	Playing an AVI file
>	this tip demonstrates how to play an AVI video file without using the Multimedia (MCI) control.
>
>	1. add a basic module with following code
>
>	declare function mciSendString Lib "winmm.dll" alias _
>	"mciSendStringA" (
>	ByVal lpstrCommand as string,
>	ByVal lpstrReturnString as string,
>	ByVal uReturnLength as long,
>	ByVal hwndCallback as long) as long
>
>	2. add following code to Form1
>
>	private Sub Form_Activate()
>	Dim returnstring as string
>	FileName as string
>	returnstring = space(127)
>	'Avifile to play'
>	FileName = "F:\Funstuff\Videos\Highperf\Welcome1.avi"
>	erg = mciSendString("open " & chr$(34) & FileName & chr$(34) 
& " type avivideo alias video", returnstring, 	127, 0)
>	erg = mciSendString("set video time format ms", returnstring, 127, 0)
>	erg = mciSendString("play video from 0", returnstring, 127, 0)
>	end Sub
>
>	'It is important to close the video, even if the file to play has run out.  
To close the video, use the following line of code:'
>
>	erg = mciSendString("close video", returnstring, 127, 0)
>#endif
>
>define class PlayAvi as relation
>
>	cFileName	=	''
>
>	function init
>		declare long <b>mciSendStringA</b> in "wimm.dll" <b>as mciSendString</b> string, string, long, long
>
>	function play
>	LOCAL lcRetString, lcFileName
>		IF not EMPTY( this.cFileName) and not EMPTY(SYS(2000,this.cFileName))
>			lcFileName = FULLPATH(this.cFileName)
>			lcRetString = space(127)
>			mciSendString(;
>				"open " + <b>chr(34)</b> + ;
>				lcFileName + <b>chr(34)</b> + ;
>				" type avivideo alias video", ;
>				lcRetString, 127, 0)
>			mciSendString("set video time format ms", lcRetString , 127, 0)
>			mciSendString("play video from 0", lcRetString , 127, 0)
>		ENDIF
>
>	function destroy
>		lcRetString = space(127)
>		= mciSendString("close video", lcRetString, 127, 0)
>
>enddefine
>
>
>Glenn
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform