PDA

View Full Version : UI module interference



Petr Schreiber
23-02-2006, 18:09
Hi,

I have a problem.
I need to use mciSendString in my next TBGL tutorial to play multiple sounds at once.

All works perfect, until I bind the UI module.

This code works:


DECLARE FUNCTION mciSendString LIB "WINMM.DLL" ALIAS "mciSendStringA" (lpstrCommand AS DWORD, lpstrReturnString AS DWORD, BYVAL uReturnLength AS DWORD, BYVAL hwndCallback AS DWORD) AS LONG


sndOperate ("Open c:\windows\media\tada.wav")
sndOperate ("Play c:\windows\media\tada.wav")
SLEEP 1000
sndOperate ("Close c:\windows\media\tada.wav")


' Functions for sound handling
FUNCTION sndOperate( sFile AS STRING ) AS LONG

LOCAL Sound AS ASCIIZ * 255

Sound = sFile
mciSendString(STRPTR(Sound), NULL, NULL, NULL)

END FUNCTION


But this, although almost the same ... not :(:


USES "UI"

DECLARE FUNCTION mciSendString LIB "WINMM.DLL" ALIAS "mciSendStringA" (lpstrCommand AS DWORD, lpstrReturnString AS DWORD, BYVAL uReturnLength AS DWORD, BYVAL hwndCallback AS DWORD) AS LONG


sndOperate ("Open c:\windows\media\tada.wav")
sndOperate ("Play c:\windows\media\tada.wav")
SLEEP 1000
sndOperate ("Close c:\windows\media\tada.wav")


' Functions for sound handling
FUNCTION sndOperate( sFile AS STRING ) AS LONG

LOCAL Sound AS ASCIIZ * 255

Sound = sFile
mciSendString(STRPTR(Sound), NULL, NULL, NULL)

END FUNCTION



Any ideas ?

Thanks,
Petr

Petr Schreiber
23-02-2006, 20:31
I apologize,

with the official release all works as it should :oops:

Thanks,
Petr