>#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 mciSendString in "wimm.dll" as alias mciSendStringA 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 " + chr$(34) + ; > lcFileName + chr$(34) + ; > " 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 >>