thanks again
with this example my project crash
i try to use it again
and this work
Dim strFilePath As String
Dim hLibrary As Long
Dim hResource As Long
Dim hData As Long
Dim lpData As Long
' Get the path to the Resource DLL
strFilePath = "Sound.dll"
' Load the Resource DLL
hLibrary = LoadLibrary(strFilePath & Chr(0))
If hLibrary = 0 Then
MsgBox "Failed to load the specified library with error code " & Err.LastDllError
Exit Sub
End If
' Get a .WAV file from the Resource DLL
hResource = FindResource(hLibrary, "#101", "CUSTOM")
If hResource <> 0 Then
hData = LoadResource(hLibrary, hResource) 'This gets a handle to the data
If hData <> 0 Then
lpData = LockResource(hData) 'This gets a POINTER to the data... which is what we need
If lpData <> 0 Then
PlaySound ByVal lpData, 0, SND_MEMORY Or SND_NODEFAULT Or SND_SYNC
End If
End If
End If
' Close the Resource DLL
FreeLibrary hLibrary
have a good afternoon