This is a subject i have been getting to for a long time.
I have read Poffs over and over on the subject. I have written about 10 examples and tried every combination and permutation you can think of. I have tried Names, Numbers etc etc to make sure i have not missed anything.
This works:
#COMPILE EXE "PlayRc.exe"
#INCLUDE "WIN32API.INC"
#RESOURCE "Sound.PBR"
'sound.rc
'DING SOUND DING.WAV
FUNCTION PBMAIN
PlaySound "DING", BYVAL GetModuleHandle(BYVAL %NULL), %SND_RESOURCE OR %SND_SYNC
MSGBOX "done"
END FUNCTION
This does work: (plays 2 .wav files)
#COMPILE EXE "PlayRc.exe"
#INCLUDE "WIN32API.INC"
#RESOURCE "Sound.PBR"
'sound.rc
'DING SOUND DING.WAV
'BITE SOUND BITE.WAV
FUNCTION PBMAIN() AS LONG
LOCAL lpWav AS BYTE PTR
hInst&=GetModuleHandle("")
hRes& = FindResource(hInst&,"DING",BYVAL %RT_RCDATA)
lpWav = LockResource(LoadResource(hInst&, hRes&))
CALL PlaySound(BYVAL lpWav,hInst&,%SND_MEMORY OR %SND_ASYNC)
FreeResource hRes&
MSGBOX "done"
hInst&=GetModuleHandle("")
hRes& = FindResource(hInst&,"BITE",BYVAL %RT_RCDATA)
lpWav = LockResource(LoadResource(hInst&, hRes&))
CALL PlaySound(BYVAL lpWav,hInst&,%SND_MEMORY OR %SND_ASYNC)
FreeResource hRes&
MSGBOX "done"
END FUNCTION
This Does Not Work: (it will not play the second .wav but NOT the first)
#COMPILE EXE "PlayRc.exe"
#INCLUDE "WIN32API.INC"
#RESOURCE "Sound.PBR"
'sound.rc
'DING SOUND DING.WAV
'BITE SOUND BITE.WAV
FUNCTION PBMAIN
PlaySound "DING", BYVAL GetModuleHandle(BYVAL %NULL), %SND_RESOURCE OR %SND_SYNC
PlaySound "BITE", BYVAL GetModuleHandle(BYVAL %NULL), %SND_RESOURCE OR %SND_SYNC
MSGBOX "done"
END FUNCTION
Why doesnt this work?
------------------
Kind Regards
Mike
I have read Poffs over and over on the subject. I have written about 10 examples and tried every combination and permutation you can think of. I have tried Names, Numbers etc etc to make sure i have not missed anything.
This works:
#COMPILE EXE "PlayRc.exe"
#INCLUDE "WIN32API.INC"
#RESOURCE "Sound.PBR"
'sound.rc
'DING SOUND DING.WAV
FUNCTION PBMAIN
PlaySound "DING", BYVAL GetModuleHandle(BYVAL %NULL), %SND_RESOURCE OR %SND_SYNC
MSGBOX "done"
END FUNCTION
This does work: (plays 2 .wav files)
#COMPILE EXE "PlayRc.exe"
#INCLUDE "WIN32API.INC"
#RESOURCE "Sound.PBR"
'sound.rc
'DING SOUND DING.WAV
'BITE SOUND BITE.WAV
FUNCTION PBMAIN() AS LONG
LOCAL lpWav AS BYTE PTR
hInst&=GetModuleHandle("")
hRes& = FindResource(hInst&,"DING",BYVAL %RT_RCDATA)
lpWav = LockResource(LoadResource(hInst&, hRes&))
CALL PlaySound(BYVAL lpWav,hInst&,%SND_MEMORY OR %SND_ASYNC)
FreeResource hRes&
MSGBOX "done"
hInst&=GetModuleHandle("")
hRes& = FindResource(hInst&,"BITE",BYVAL %RT_RCDATA)
lpWav = LockResource(LoadResource(hInst&, hRes&))
CALL PlaySound(BYVAL lpWav,hInst&,%SND_MEMORY OR %SND_ASYNC)
FreeResource hRes&
MSGBOX "done"
END FUNCTION
This Does Not Work: (it will not play the second .wav but NOT the first)
#COMPILE EXE "PlayRc.exe"
#INCLUDE "WIN32API.INC"
#RESOURCE "Sound.PBR"
'sound.rc
'DING SOUND DING.WAV
'BITE SOUND BITE.WAV
FUNCTION PBMAIN
PlaySound "DING", BYVAL GetModuleHandle(BYVAL %NULL), %SND_RESOURCE OR %SND_SYNC
PlaySound "BITE", BYVAL GetModuleHandle(BYVAL %NULL), %SND_RESOURCE OR %SND_SYNC
MSGBOX "done"
END FUNCTION
Why doesnt this work?
------------------
Kind Regards
Mike
Comment