Discuss this help topic in MsgConnect Forum

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



Messenger.OnValidateCredentials

Messenger     See also    


This event is used to validate credentials passed by the sender.

Declaration

[C++]
    typedef void (STDCALLCONV *MCValidateCredentialsEvent)(void* UserData, void* Sender, MCMessage* Message, MCMessageCredentials* Credentials, bool& Valid);
    void setOnValidateCredentials(MCValidateCredentialsEvent handler, void *UserData = NULL);
    MCValidateCredentialsEvent getOnValidateCredentials(void * *UserData);

[Pascal]
    property OnValidateCredentials : TMCValidateCredentialsEvent;
    TMCValidateCredentialsEvent = procedure (Sender: TObject; Message : PMCMessage; Credentials : PMCMessageCredentials; var Valid : boolean) of object;

[VB6]
    Event MCXMessenger2.OnValidateCredentials(Message As IMCXMessage, Credentials As MCXMessageCredentials, Valid As Boolean)

[ActiveX]
    void IMCXMessengerEvents2.OnValidateCredentials([in] IMCXMessage * MessageMessage, [in] IMCXMessageCredentials * Credentials, [in, out] VARIANT_BOOL * Valid );

[C#]
    public delegate void MCValidateCredentialsEvent(object Sender, MCValidateCredentialsEventArgs Arg);
    public class MCValidateCredentialsEventArgs: EventArgs
    {
        public MCMessage Message;
        public MCMessageCredentials Credentials;
        public bool Valid = true;
    }

[VB.NET]
    Public Event OnValidateCredentials As MCValidateCredentialsEvent
    Public Delegate Sub MCValidateCredentialsEvent(ByVal Sender As Object, ByVal Arg As MCValidateCredentialsEventArgs)
    Public Class MCValidateCredentialsEventArgs
        Public Message As MCMessage
        Public Credentials As MCMessageCredentials
        Public Valid As Boolean = True
    End Class

[Java]
    public interface ValidateCredentialsListener extends EventListener {
        public boolean ValidateCredentials(ValidateCredentialsEvent e);
    }     public class ValidateCredentialsEvent extends EventObject {
        public MCMessage getMessage();
        public MCMessageCredentials getCredentials();
    }
    void addValidateCredentialsListener(ValidateCredentialsListener l);
    void removeValidateCredentialsListener(ValidateCredentialsListener l);

[Java ME]
    public interface ValidateCredentialsListener extends EventListener {
        public boolean ValidateCredentials(ValidateCredentialsEvent e);
    }     public class ValidateCredentialsEvent extends EventObject {
        public MCMessage getMessage();
        public MCMessageCredentials getCredentials();
    }
    void addValidateCredentialsListener(ValidateCredentialsListener l);
    void removeValidateCredentialsListener(ValidateCredentialsListener l);

[DLL]
    void __stdcall MCMessengerSetOnValidateCredentials(HMCMessenger h, ValidateCredentialsProc Code, long UserData);
    void __stdcall MCMessengerGetOnValidateCredentials(HMCMessenger h, ValidateCredentialsProc* Code, long* UserData);
    __stdcall void (*ValidateCredentialsProc)(long UserData, HMC Reserved, MCMessage Message, MCMessageCredentials* Credentials, bool* Valid);

Parameters

  • [DLL]h - handle to the Messenger object that was returned by Create method
  • [DLL]Code - pointer to the callback function that is called to validate credentials
  • [DLL]UserData - application-defined data that is passed back to the callback function

  • Message - the message that was sent with given credentials.
  • Credentials - credentials specified by the sender.
  • Valid - set this value to true to allow message processing or to false to discard the message.

Description

    This event is fired by the messenger when the message arrives. It lets you control who is the sender of the message and permit or cancel message processing.

    The event is fired in context of transport thread (not messenger thread).

Discuss this help topic in MsgConnect Forum