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



BaseRouter.OnTranslateAddress

BaseRouter     See also    


This event is fired when the router routes the message.

Declaration

[C++]
    typedef void (STDCALLCONV *IPCTranslateAddressEvent)(void* UserData, void* Sender, char* Address, char* *RouteTo, bool& UseDefaultRouting);
    public void setOnTranslateAddress(IPCTranslateAddressEvent Value, void *UserData = NULL);
    public IPCTranslateAddressEvent getOnTranslateAddress(void * *UserData);

[Pascal]
    property OnTranslateAddress: TIPCTranslateAddressEvent;
    TIPCTranslateAddressEvent = procedure (Sender :TObject; Address : string; RouteTo : string; UseDefaultRouting : boolean) of object;

[VB6]
    Sub IIPCXRouterEvents.OnTranslateAddress(ByVal Address As String, RouteTo As String, UseDefaultRoutingTable As Boolean)

[ActiveX]
    void IIPCXRouterEvents.OnTranslateAddress( [in] BSTR Address, [in, out] BSTR* RouteTo, [in, out] VARIANT_BOOL * UseDefaultRouting);

[C#]
    public IPCTranslateAddressEvent OnTranslateAddress;
    public delegate void IPCTranslateAddressEvent(object Sender, IPCTranslateAddressEventArgs Args);
    public class IPCTranslateAddressEventArgs:EventArgs
    {
        public string Address,
        public string RouteTo,
        public bool UseDefaultRouting;
    }

[VB.NET]
    Public Event OnTranslateAddress As IPCTranslateAddressEvent
    Public Delegate Sub IPCTranslateAddressEvent(ByVal Sender As Object, ByVal Args As IPCTranslateAddressEventArgs)
    Public Class IPCTranslateAddressEventArgs
        Public Address As String
        Public RouteTo As String
        Public UseDefaultRoutingTable As Boolean
    End Class

[Java]

    public class IPCTranslateAddressEvent {
        public IPCRouter getSender();
        public String getAddress();
        public String getRouteTo();
        public void setRouteTo(String aRouteTo);
        public boolean getUseDefaultRoutingTable();
        public void setUseDefaultRoutingTable(boolean aUseDefaultRoutingTable);
    }
    public abstract interface IPCTranslateAddressListener {
        public boolean translateAddress(IPCTranslateAddressEvent e);
    }
    public void removeTranslateAddressListener(IPCTranslateAddressListener l);
    public void addTranslateAddressListener(IPCTranslateAddressListener l);

[Java ME]

    public class IPCTranslateAddressEvent {
        public IPCRouter getSender();
        public String getAddress();
        public String getRouteTo();
        public void setRouteTo(String aRouteTo);
        public boolean getUseDefaultRoutingTable();
        public void setUseDefaultRoutingTable(boolean aUseDefaultRoutingTable);
    }
    public abstract interface IPCTranslateAddressListener {
        public boolean translateAddress(IPCTranslateAddressEvent e);
    }
    public void removeTranslateAddressListener(IPCTranslateAddressListener l);
    public void addTranslateAddressListener(IPCTranslateAddressListener l);

[DLL]
    void __stdcall IPCRouterSetOnTranslateAddress(HIPCMessenger h, TranslateAddressProc Code, long UserData);
    void __stdcall IPCRouterGetOnTranslateAddress(HIPCMessenger h, TranslateAddressProc* Code, long* UserData);
    void (__stdcall *TranslateAddressProc)(long UserData, HIPC Reserved, char* Address, char* *RouteTo, bool& UseDefaultRouting);

Parameters

  • [DLL]h - handle to the Router object that was returned by Create method
  • [DLL]Code - pointer to the callback function that is called to handle the message

  • UserData - application-defined data that is passed back to the callback function.
  • Address - the address that the message was sent to.
  • RouteTo - set this value to the valid CBFS IPC address if you want to "manually" route the message to another address.
  • UseDefaultRouting - set this value to true if default routing rules should be used. Set this value to false if you have set RouteTo to custom value.

Description

    This event is fired by the router when the message is to be sent to destination. Such event provides a handy way to route various messages to various destinations.

Message routing