Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/11/2004, 14:05
rojobe55
 
Fecha de Ingreso: febrero-2003
Ubicación: Costa Rica
Mensajes: 133
Antigüedad: 21 años, 3 meses
Puntos: 0
De acuerdo gracias por responder... y otros comentarios.

Antes que nada te agradezco que me hayas respondido tan rápido.

Como decís, si utilizo el mscomm.
El ejemplo que me aconsejas analice, utiliza el susodicho componente para conectar dos maquinas, interesante.
Sucede que como te digo, todo eso lo puedo hacer sin problemas, manejo los eventos también sin problema, logro la comunicación, puedo transmitir datos y todo eso, pero no puedo hacer que se emita un sonido.

Trato de utilizar esa línea abierta y conectada, para que por ella no se transmitan datos, solo se emita un sonido, como un pito o un mensaje.

He pensado que si pudiese lograr averiguar cual es el manejador (handle) del puerto abierto o del mscomm, quizás lo pueda poner en el uDevideID de estas funciones, porque el hMidiout se debe referir al dispositivo que reproduce el sonido, supongo...

Public Declare Function midiOutClose Lib "winmm.dll" _
(ByVal hMidiOut As Long) As Long

Public Declare Function midiOutOpen Lib "winmm.dll" _
(lphMidiOut As Long, _
ByVal uDeviceID As Long, _
ByVal dwCallback As Long, _
ByVal dwInstance As Long, _
ByVal dwFlags As Long) As Long

Public Declare Function midiOutShortMsg Lib "winmm.dll" _
(ByVal hMidiOut As Long, _
ByVal dwMsg As Long) As Lo


En dwMsg pondria el mensaje o el conjunto de sonidos a emitir con una estructura así

midiOutShortMsg hMidiOut, 6537277 por ejemplo..


La gente del KPDteam me da esta explicación de estas funciones pero no logro interpretarlas correctamente (debido a mi bajo nivel de ingles supongo...)

• lphmo
Address of an HMIDIOUT handle. This location is filled with a handle identifying the opened MIDI output device. The handle is used to identify the device in calls to other MIDI output functions.

• uDeviceID
Identifier of the MIDI output device that is to be opened.

• dwCallback
Address of a callback function, an event handle, a thread identifier, or a handle of a window or thread called during MIDI playback to process messages related to the progress of the playback. If no callback is desired, specify NULL for this parameter. For more information on the callback function, see MidiOutProc.

• dwCallbackInstance
User instance data passed to the callback. This parameter is not used with window callbacks or threads.

• dwFlags
Callback flag for opening the device. It can be the following values:
CALLBACK_EVENT
The dwCallback parameter is an event handle. This callback mechanism is for output only.
CALLBACK_FUNCTION
The dwCallback parameter is a callback function address.
CALLBACK_NULL
There is no callback mechanism. This value is the default setting.
CALLBACK_THREAD
The dwCallback parameter is a thread identifier.
CALLBACK_WINDOW
The dwCallback parameter is a window handle.

Quizás a ti te resulte mas claro y tengas algún comentario al respecto, te agradeceré…

‘’’’’’’’’’’’’’’’’’’’’’’’’’’’’’
Otra alternativa que estoy probando es la tapiRequestMakeCall

The tapiRequestMakeCall function requests the establishment of a voice call. A call-manager application is responsible for establishing the call on behalf of the requesting application, which is then controlled by the user's call-manager application.

Según lo que entiendo, la funcion solicita el establecimiento una llamada de vos

(de traducción por altavista sorry)
La función del tapiRequestMakeCall solicita el establecimiento de una llamada de voz. Un uso del llamar-encargado es responsable de establecer el favor del invitar del uso de petición, que entonces es controlado por el uso del llamar-encargado de user's.

cuya estructura es la siguiente:

Declare Function tapiRequestMakeCall Lib "TAPI32.DLL" (ByVal Dest As String, ByVal AppName As String, ByVal CalledParty As String, ByVal Comment As String) As Long

en donde

• lpszDestAddress
A pointer to a memory location where the null-terminated destination address of the call request is located. The address can use the canonical address format. Validity of the specified address is not checked by this operation. The maximum length of the address is TAPIMAXDESTADDRESSSIZE characters, which includes the NULL terminator.

• lpszAppName
A pointer to a memory location where the null-terminated user-friendly application name of the call request is located. This pointer can be left NULL if the application does not supply an application name. The maximum length of the address is TAPIMAXAPPNAMESIZE characters, which includes the NULL terminator. Longer strings are truncated.

• lpszCalledParty
A pointer to a memory location where the null-terminated called party name for the called party of the call is located. This pointer can be left NULL if the application does not wish to supply this information. The maximum length of the string is TAPIMAXCALLEDPARTYSIZE characters, which includes the NULL terminator. Longer strings are truncated.

• lpszComment
A pointer to a memory location where the null-terminated comment about the call is located. This pointer can be left NULL if the application does not supply a comment. The maximum length of the address is TAPIMAXCOMMENTSIZE characters, which includes the NULL terminator. Longer strings are truncated.


el ejemplo que pone nuestros amigos del mismo team es el siguiente:

'Example by Joacim Andersson ([email protected]) 'Author comments: I often get asked the question "How can 'I dial a phone number from VB?". Well, you can add 'the MSCOMM32.OCX control to a form but that isn't necessary 'if you just want to dial a phone number.
Private Declare Function tapiRequestMakeCall Lib "TAPI32.DLL" (ByVal Dest As String, ByVal AppName As String, ByVal CalledParty As String, ByVal Comment As String) As Long
Private Sub PhoneCall(sNumber As String, sName As String) Dim lRetVal As Long lRetVal = tapiRequestMakeCall(Trim$(sNumber), App.Title, Trim$(sName), "") If lRetVal <> 0 Then 'Couldn't make the call. 'Take appropriate action End If End Sub
Private Sub Form_Load() PhoneCall "123456", "TheName" End Sub
(y esta es la forma que utilizaría para llamar sin el mscomm…)

Y para explicar sus parámetros (siguiendo con altavista)

DestAddress
una posición de memoria en donde la dirección de destinación nulo-terminada de la petición de la llamada se localiza. La dirección puede utilizar el formato de dirección canónico. La validez de la dirección especificada no es comprobada por esta operación

AppName
una posición de memoria en donde el nombre de uso fácil nulo-terminado del uso de la petición de la llamada se localiza. Este indicador puede ser dejado NULO si el uso no provee un nombre del uso

CalledParty
una posición de memoria en donde el nombre llamado nulo-terminado del partido para el partido llamado de la llamada se localiza. Este indicador puede ser dejado NULO si el uso no desea proveer esta información.

Comment
una posición de memoria en donde el comentario nulo-terminado sobre la llamada se localiza. Este indicador puede ser dejado NULO si el uso no provee un comentario.

Aparentemente, esta función, llama y pretende que uno levante el fono para hablar, por ello, si luego de efectuar la llamada emito un sonido por los parlantes del equipo, es posible que se escuche desde el otro lado si tengo el micrófono abierto, pero me parece una perrogullada (léase situación no muy católica que digamos…)
Bueno, hasta aquí llegue, espero no aburrirte con este tema y me parece que me he extendido mucho porque fuiste la única persona que alguna vez me ha respondido en toda mi vida en este foro. Quizás porque mis consultas no fueron muy elocuentes o interesantes o no se por que, pero desde ya gracias por contestarme.

Si tenes algún comentario a lo escrito, esperare tu respuesta. Saludos cordiales.