PostHighLevelEvent
msgLen, postingOptions);
Ptr msgBuff ; Additional data associated with event theEvent is a pointer to the event record to be posted to another application.
receiverID is the ID of the receiver for this event. You can specify the receiver
of the event by sessionID, process serial number, signature, or
port name and port location. You can use any of these specifications
to send an event to another application on the local machine. You can
use only the sessionID or port name and port location to send an event
to an application on a remote machine.
msgRefcon is a parameter which is a unique number that is used to identify this
event. If you send a response to this event, you should specify the
same value of msgRefcon so that the sender of the event can associate
the reply with the original request. You may use any value of your
choice.
msgBuff is a parameter which points to any additional data associated with
the event. The msgLen parameter contains the size of the buffer. Your
application is responsible for allocating the memory for the
additional data pointed to by the msgBuff parameter. If the msgBuff
parameter points to an area in memory that is not large enough for
bufferIsSmall, the msgLen parameter contains the number of bytes
rest of the data.
msgLen is the number of bytes remaining in the message buffer. It is the
size of the message buffer.
postingOptions is a parameter used to specify delivery options and options
associated with the receiverID parameter. You can specify one or
more delivery options to indicate whether you want the other
application to receive the event at the next opportunity and to
indicate whether you want acknowledgment that the event was
received by the other application. You use the options associated with
the receiverID parameter to indicate how you are specifying the
values for this parameter.
Returns: an operating system Error Code. It will be one of: noErr (0) No error
bufferIsSmall (-607) Buffer is too small
noOutstandingHLE (-608) No outstanding high-level event
connectionInvalid (-609) Connection is invalid
noUserInteractionAllowed (-610) Cannot interact directly with user
sessionClosedErr (-917) Session closed
Notes: If the application to which you are sending a high-level event terminates,
If you do not care about any state information about that session, you can
just resend your event. Otherwise, you must restart another session and
resend your event.
If your application is running in the background and posts a
high-level event that requires the network authentication dialog box to be
displayed, your application will receive a noUserInteractionAllowed result
code. This prevents a background application from displaying a modal dialog.
your application needs attention. When the user brings your application to
the foreground, you can repost the event. If the reposting is successful,
your application can return to the background and continue to post
high-level events without further user interaction. Note that the error
noUserInteractionAllowed is returned only on the first posting of a
high-level event to a remote target.