Discuss this help topic in MsgConnect Forum

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 *MCTranslateAddressEvent)(void* UserData, void* Sender, char* Address, char* *RouteTo, bool& UseDefaultRouting);
    public void setOnTranslateAddress(MCTranslateAddressEvent Value, void *UserData = NULL);
    public MCTranslateAddressEvent getOnTranslateAddress(void * *UserData);

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

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

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

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

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

[Java]

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

[Java ME]

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

[DLL]
    void __stdcall MCRouterSetOnTranslateAddress(HMCMessenger h, TranslateAddressProc Code, long UserData);
    void __stdcall MCRouterGetOnTranslateAddress(HMCMessenger h, TranslateAddressProc* Code, long* UserData);
    void (__stdcall *TranslateAddressProc)(long UserData, HMC 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 MsgConnect 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    

Discuss this help topic in MsgConnect Forum