Charles,
This will let us use LinkRes2Exe with imbedded wav files as RCDATA instead of WAVE.
James
use rtl64
use corewin
% SND_MEMORY = 4
DECLARE FUNCTION sndPlaySound LIB "WINMM.DLL" ALIAS "sndPlaySoundA" (azsSound AS ASCIIZ,BYVAL Opts AS DWORD)AS INT
DECLARE FUNCTION PBMAIN() AS INT
'==============================================================================
Function PlayRcSound (hInst as sys, SndName As sys) As Integer
Dim As sys hr,hg,id,lpSndData
id = 10
hr = FindResource (hInst, (char*)SndName, (char*)id)
If hr <> 0 Then
hg = LoadResource (hInst, hr)
If hg <> 0 Then
lpSndData = LockResource (hg)
If lpSndData <> 0 Then
sndPlaySound ((char*)lpSndData, SND_MEMORY)
return 1
Else
return 0
End If
Else
return 0
End If
Else
return 0
End If
Function = 0
End Function
'==============================================================================
Sub main()
If PlayRcSound(GetModuleHandle(0),100)
Print "Sound Played"
Else
Print "No Sound"
End If
End Sub
main()
'==============================================================================
Resource File
#define IDC_WAV 100
IDC_WAV RCDATA DISCARDABLE "executing.wav"