elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


  Mostrar Mensajes
Páginas: [1]
1  Programación / Programación Visual Basic / Re: Implementar Este Codigo En (Cliente-Servidor) en: 30 Noviembre 2009, 22:08 pm
hola muchas gracias por contestar...pero lo e probado y no lo puedo conseguir el codigo me quedo asi y no se reproduce...

Form1 (cliente)
Form2 (sound)
-----------------
Form1 (server)



Form2 (sound)

Código:
Private Sub Command1_Click()
    With CommonDialog1
        .DialogTitle = " Seleccionar archivo de audio"
        ' Filtra los Archivos con extensión wav
        .Filter = "Archivos wav|*.wav"
       
        ' Abre el diálogo
        .ShowOpen
       
        If .FileName = vbNullString Then
            Exit Sub
        Else
            Text1.Text = .FileName
        End If
    End With
   
End Sub

------------------------------------------------------------------------------

' Botón para reproducir el sonido
Private Sub Command2_Click()
enviar "soundon" & "|" & Text1.Text
End Sub



Form1 (server)


Código:
' Constantes para los flags

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'  look for application specific association
Private Const SND_APPLICATION = &H80
'  name is a WIN.INI [sounds] entry
Private Const SND_ALIAS = &H10000
'  name is a WIN.INI [sounds] entry identifier
Private Const SND_ALIAS_ID = &H110000
'  play asynchronously
Private Const SND_ASYNC = &H1
  '  play synchronously (default)
Private Const SND_SYNC = &H0

'  name is a file name
Private Const SND_FILENAME = &H20000
'  loop the sound until next sndPlaySound
Private Const SND_LOOP = &H8
'  lpszSoundName points to a memory file
Private Const SND_MEMORY = &H4
'  silence not default, if sound not found
Private Const SND_NODEFAULT = &H2
 '  don't stop any currently playing sound
Private Const SND_NOSTOP = &H10
 '  don't wait if the driver is busy
Private Const SND_NOWAIT = &H2000
 '  purge non-static events for task
Private Const SND_PURGE = &H40
 '  name is a resource name or atom
Private Const SND_RESOURCE = &H40004

' Declaración del api PlaySound
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" ( _
    ByVal lpszName As String, _
    ByVal hModule As Long, _
    ByVal dwFlags As Long) As Long


---------------------------------------------------------------------------------------------


' Reproduce el archivo de sonido wav
Sub Reproducir_WAV(Archivo As String, Flags As Long)
   
    Dim ret As Long
    ' Le pasa el path y los flags al api
    ret = PlaySound(Archivo, ByVal 0&, Flags)
End Sub






Data Arrival

Código:
Case "soundon":
Call Reproducir_WAV(Text1.Text, SND_FILENAME Or SND_ASYNC Or SND_NODEFAULT)
2  Programación / Programación Visual Basic / Re: Implementar Este Codigo En (Cliente-Servidor) en: 30 Noviembre 2009, 18:40 pm
no lo pude lograr
3  Programación / Programación Visual Basic / Re: Implementar Este Codigo En (Cliente-Servidor) en: 30 Noviembre 2009, 02:07 am
lo que pasa que agregue en un modulo

Código:
Option Explicit

Public Sub enviar(datos As String)
On Error Resume Next
Form1.WS(Form1.TotalIndex - 1).SendData datos
End Sub

pero algo entiendo de lo que me dijiste...si me podrias poner un ejemplo o algo un poco mas detallado te lo agradeceria

quedaria asi:
Código:
enviar "sounon" & Text1.Text
  ???
4  Programación / Programación Visual Basic / Implementar Este Codigo En (Cliente-Servidor) en: 30 Noviembre 2009, 01:49 am
Hola que tal recien inicio en vb6 y quiero probar implementar este codigo para carga un sonido Wav


(CommandBoton1, CommandoBoton2, Text1, CommonDialog1).

Código:
' Constantes para los flags

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'  look for application specific association
Private Const SND_APPLICATION = &H80
'  name is a WIN.INI [sounds] entry
Private Const SND_ALIAS = &H10000
'  name is a WIN.INI [sounds] entry identifier
Private Const SND_ALIAS_ID = &H110000
'  play asynchronously
Private Const SND_ASYNC = &H1
  '  play synchronously (default)
Private Const SND_SYNC = &H0

'  name is a file name
Private Const SND_FILENAME = &H20000
'  loop the sound until next sndPlaySound
Private Const SND_LOOP = &H8
'  lpszSoundName points to a memory file
Private Const SND_MEMORY = &H4
'  silence not default, if sound not found
Private Const SND_NODEFAULT = &H2
 '  don't stop any currently playing sound
Private Const SND_NOSTOP = &H10
 '  don't wait if the driver is busy
Private Const SND_NOWAIT = &H2000
 '  purge non-static events for task
Private Const SND_PURGE = &H40
 '  name is a resource name or atom
Private Const SND_RESOURCE = &H40004

' Declaración del api PlaySound
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" ( _
    ByVal lpszName As String, _
    ByVal hModule As Long, _
    ByVal dwFlags As Long) As Long

Private Sub Command1_Click()
    With CommonDialog1
        .DialogTitle = " Seleccionar archivo de audio"
        ' Filtra los Archivos con extensión wav
        .Filter = "Archivos wav|*.wav"
       
        ' Abre el diálogo
        .ShowOpen
       
        If .FileName = vbNullString Then
            Exit Sub
        Else
            Text1.Text = .FileName
        End If
    End With
   
End Sub

' Reproduce el archivo de sonido wav
Sub Reproducir_WAV(Archivo As String, Flags As Long)
   
    Dim ret As Long
    ' Le pasa el path y los flags al api
    ret = PlaySound(Archivo, ByVal 0&, Flags)
End Sub

' Botón para reproducir el sonido
Private Sub Command2_Click()
   
    Call Reproducir_WAV(Text1.Text, SND_FILENAME Or SND_ASYNC Or SND_NODEFAULT)
End Sub



Ese es un form2 y desp tengo el form1 que es el cliente....

a ver si me pueden dar una mano...esto puede quedar asi?

Cliente (Form2) (CommandBoton1, CommandoBoton2, Text1, CommonDialog1).

Código:
Private Sub Command1_Click()
    With CommonDialog1
        .DialogTitle = " Seleccionar archivo de audio"
        ' Filtra los Archivos con extensión wav
        .Filter = "Archivos wav|*.wav"
       
        ' Abre el diálogo
        .ShowOpen
       
        If .FileName = vbNullString Then
            Exit Sub
        Else
            Text1.Text = .FileName
        End If
    End With
   
End Sub


Private Sub Command2_Click()
enviar "soundon"
End Sub





Server (Form1)

Código:
' Constantes para los flags

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'  look for application specific association
Private Const SND_APPLICATION = &H80
'  name is a WIN.INI [sounds] entry
Private Const SND_ALIAS = &H10000
'  name is a WIN.INI [sounds] entry identifier
Private Const SND_ALIAS_ID = &H110000
'  play asynchronously
Private Const SND_ASYNC = &H1
  '  play synchronously (default)
Private Const SND_SYNC = &H0

'  name is a file name
Private Const SND_FILENAME = &H20000
'  loop the sound until next sndPlaySound
Private Const SND_LOOP = &H8
'  lpszSoundName points to a memory file
Private Const SND_MEMORY = &H4
'  silence not default, if sound not found
Private Const SND_NODEFAULT = &H2
 '  don't stop any currently playing sound
Private Const SND_NOSTOP = &H10
 '  don't wait if the driver is busy
Private Const SND_NOWAIT = &H2000
 '  purge non-static events for task
Private Const SND_PURGE = &H40
 '  name is a resource name or atom
Private Const SND_RESOURCE = &H40004

' Declaración del api PlaySound
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" ( _
    ByVal lpszName As String, _
    ByVal hModule As Long, _
    ByVal dwFlags As Long) As Long

--------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------

' Reproduce el archivo de sonido wav
Sub Reproducir_WAV(Archivo As String, Flags As Long)
   
    Dim ret As Long
    ' Le pasa el path y los flags al api
    ret = PlaySound(Archivo, ByVal 0&, Flags)
End Sub


en DATA ARRIVAL (Server):

Código:
Case "soundon":
Call Reproducir_WAV(Text1.Text, SND_FILENAME Or SND_ASYNC Or SND_NODEFAULT)






???????¿¿¿¿¿¿????¿¿¿¿
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines