Filter: C++  Pascal  C#  VB.NET  Java  Java ME  ActiveX  DLL 



Messenger.SendMessageCallback

Messenger     See also    


Sends a message to the recipient, request reply and return immediately. Callback function is called when reply is available or message is returned with failure.

Declaration

[C++]
    void SendMessageCallback(char* Destination, IPCMessage* Message, IPCNotifyProc NotifyProc, unsigned long UserData, IPCMessageCredentials* Credentials);

[Pascal]
    procedure SendMessageCallback(Destination : string; var Message : TIPCMessage; NotifyProc : TIPCNotifyProc; UserData : DWORD; Credentials : PIPCMessageCredentials);

[VB6]
    Sub SendMessageCallback(Destination As String, Message As IIPCXMessage, Credentials As IPCXMessageCredentials)

[ActiveX]
    HRESULT _stdcall SendMessageCallback([in] BSTR Destination, [in] IIPCXMessage * Message, [in] IIPCXMessageCredentials * Credentials);

NotifyProc parameter is not available. Callback is implemented as OnCompletion event in IPCXMessenger object.

[C#]
    public void SendMessageCallback( string Destination, IPCMessage Message, IPCNotifyProc CompletionProc, object UserData, IPCMessageCredentials* Credentials);

[VB.NET]
    Public Sub SendMessageCallback(ByVal Destination As String, ByVal Message As IPCMessage, ByVal CompletionProc As IPCNotifyProc, ByVal UserData As Object, ByVal Credentials As IPCMessageCredentials)

[Java]
    public void sendMessageCallback( String Destination, IPCMessage Message, IPCNotifyProc completionProc, Object userData, IPCMessageCredentials credentials);

[Java ME]
    public synchronized void sendMessageCallback( String Destination, IPCMessage Message, IPCNotifyProc completionProc, Object userData, IPCMessageCredentials credentials);

[Palm]
    void SendMessageCallback( char* Destination, IPCMessage* Message, IPCNotifyProc CompletionProc, DWORD UserData, IPCMessageCredentials* Credentials);

[DLL]
    long __stdcall IPCMessengerSendMessageCallback(HIPCMessenger h, char* Destination, IPCMessage* Message, IPCNotifyProc NotifyProc, unsigned long UserData, IPCMessageCredentials* Credentials);

Parameters

  • [DLL]h - handle to the Messenger object that was returned by Create method

  • Destination - The address of the message recipient. See more here
  • Message - The message to be sent. See more here
  • NotifyProc - The function that will be called when the reply is received or the message is returned as failed.
  • UserData - Application-defined parameter that will be passed as a first parameter of the NotifyProc function. This lets you set NotifyProc to a reference to class memeber, and pass an instance reference in UserData parameter
  • Credentials - (optional) Credentials to be set for the message. Can be set to null (nil) if credentials system is not used. See more here

Return value

[DLL]
    IPC_OK is always returned.

Description

    Call this method to send the message to some other messenger and be notifed when the result arrives or the message is returned as failed. Destination specifies the address of the recipient. This method determines the right transport to use and passes the message to the transport. If the transport was not found or the request didn't reach the recipient for some reason, an exception is raised. [DLL] Error is determined by return value.
    Result of the message is passed together with message data to the callback function defined by NotifyProc. For information about error and timeout handling see Error and Timeout Handling topic.