Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/04/2010, 03:21
truskyvb
 
Fecha de Ingreso: octubre-2008
Mensajes: 188
Antigüedad: 15 años, 6 meses
Puntos: 3
Reproductor MP3

Buen día a todos. Estoy atascado en un código y aquí dejo la pregunta por si podéis echarme una mano.

Creo un archivo de recursos llamado Proyecto1.RES
Ese archivo contiene dos canciones: ID 101 (un tema MP3) e ID 102 (otro tema MP·)

Inserto un control MMC en el formulario llamado mmcMP3

Private Sub Form_Load()
mmcMP3.DeviceType = "MPEGVideo"
mmcMP3.FileName = "Proyecto1.RES"
mmcMP3.Command = "Open"
mmcMP3.Command = "Play"
End Sub


Private Sub Form_Unload(Cancel As Integer)
mmcMP3.Command = "Stop"
mmcMP3.Command = "Close"
End Sub


Todo funciona bien. El problema es que en el archivo RES hay dos ID, y no se como elegir una u otra.


He probado esto y no funciona:

Private Sub Form_Load()
mmcMP3.DeviceType = "MPEGVideo"
mmcMP3.FileName = "LoadResData(101, "CUSTOM")"
mmcMP3.Command = "Open"
mmcMP3.Command = "Play"
End Sub

Private Sub Form_Load()
mmcMP3.DeviceType = "MPEGVideo"
mmcMP3.FileName = "Proyecto1.RES (101, "CUSTOM")"
mmcMP3.Command = "Open"
mmcMP3.Command = "Play"
End Sub


Private Sub Form_Load()
Dim WaveBuffer As String, ResourceId As Long
ResourceId = 101 ó 102
WaveBuffer = StrConv(LoadResData(ResourceId, "CUSTOM"), vbUnicode)
mmcMP3.FileName = "WaveBuffer"
mmcMP3.Command = "Open"
mmcMP3.Command = "Play"
End Sub

Ojalá que alguien pueda darme alguna idea. Gracias y un saludo