Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
To VP or not VB that is the question
Message
 
 
À
10/12/2001 09:40:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00592024
Message ID:
00592050
Vues:
18
The name of dll is winmm.dll not wimm.dll. In addition, tt's also possible that you'll have to pass both string by reference.

>Thanks Sergey, but no cigar! I made the changes as specified and VFP still complains that
>Cannot load 32 bit DLL
>
>
>The DLL does exist in the Windows/System directory. Can you load it?
>
>Glenn
>
>
>>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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform