Microsoft DirectX 8.1 (Visual Basic)

DirectPlay8Server.SendTo

Transmits data to the specified player. The message can be sent synchronously or asynchronously.

SendTo(idSend As Long, _
     buffer() As BYTE, _
    lPriority As Long, _
    lTimeOut As Long, _
    lFlags As CONST_DPNSENDFLAGS) As Long

Parts

idSend
Long value specifying the identifier of the player to receive data.
buffer()
Array of type BYTE that describes the data to send.
lPriority
Priority of the message.
lTimeOut
Number of milliseconds to wait for the message to be sent. If the message has not been sent by the lTimeOut value, the message is not sent. If you do not want a time-out for message sends, set this parameter to 0.
lFlags
Flags that describe send behavior. You can set one or more of the flags defined in the CONST_DPNSENDFLAGS enumeration.

Return Values

Returns the asynchronous handle for this operation. This is the handle that is used in lAsyncHandle parameter of the DirectPlay8Server.CancelAsyncOperation method to cancel the request, if the request is processed asynchronously.

Error Codes

If the method fails, Err.Number can be set to one of the following values.

DPNERR_INVALIDFLAGS
DPNERR_TIMEDOUT

Remarks

This method will call the DirectPlay8Event.Receive method in the recipient's message handler. When the SendTo request is completed, the DirectPlay8Event.SendComplete method is called in the sender's message handler. The SendComplete method contains a DPNMSG_SEND_COMPLETE message type. The success or failure of the request is contained in the hResultCode member of this message type.