Important: The information in this document is obsolete and should not be used for new development.
SendMessage
You can use theSendMessage
function to send a specified message to the current message target.
OSErr SendMessage (long messageSelector,...);
messageSelector
- The number of the message to be sent to the message handler.
- additional parameters
Parameters associated with the message sent.- function result
- An error of type
OSErr.
DESCRIPTION
TheSendMessage
function dispatches a message to the topmost handler in the message class that is the parent of the current message target.The
messageSelector
parameter indicates which message is to be sent.The ellipsis character at the end of the parameter list indicates that the remaining additional parameters are unspecified; the caller must pass whatever parameters are expected by the recipient of the message identified by the
messageSelector
parameter. By definition, all message overrides return a result of typeOSErr
. It is an error to call theSendMessage
function except from within a message handler. In any other case, behavior is undefined.The
OSErr
error returned may indicate that the message could not be sent. If no error occurs, the function result isnoErr
. In addition, the receiving message handler may return an error of typeOSErr
.SEE ALSO
To forward a specified message to the next message handler, use the ForwardMessage function described in the next section.To forward the current message to the next message handler, use the
ForwardThisMessage
function described on page 6-25.The use of the
SendMessage
function is described in the section "Sending and Forwarding Messages" beginning on page 6-15.