Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Environment and Utilities /
Chapter 6 - Message Manager / Message Manager Reference
Functions / Sending and Forwarding Messages


You can use the SendMessage function to send a specified message to the current message target.

OSErr SendMessage (long 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.
The SendMessage 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 type OSErr. It is an error to call the SendMessage 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 is noErr. In addition, the receiving message handler may return an error of type OSErr.

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.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996