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 *IPCValidateCredentialsEvent)(void* UserData, void* Sender, IPCMessage* Message, IPCMessageCredentials* Credentials, bool& Valid);
    void setOnValidateCredentials(IPCValidateCredentialsEvent handler, void *UserData = NULL);
    IPCValidateCredentialsEvent getOnValidateCredentials(void * *UserData);

[Pascal]
    property OnValidateCredentials : TIPCValidateCredentialsEvent;
    TIPCValidateCredentialsEvent = procedure (Sender: TObject; Message : PIPCMessage; Credentials : PIPCMessageCredentials; var Valid : boolean) of object;

[VB6]
    Event IPCXMessenger2.OnValidateCredentials(Message As IIPCXMessage, Credentials As IPCXMessageCredentials, Valid As Boolean)

[ActiveX]
    void IIPCXMessengerEvents2.OnValidateCredentials([in] IIPCXMessage * MessageMessage, [in] IIPCXMessageCredentials * Credentials, [in, out] VARIANT_BOOL * Valid );

[C#]
    public delegate void IPCValidateCredentialsEvent(object Sender, IPCValidateCredentialsEventArgs Arg);
    public class IPCValidateCredentialsEventArgs: EventArgs
    {
        public IPCMessage Message;
        public IPCMessageCredentials Credentials;
        public bool Valid = true;
    }

[VB.NET]
    Public Event OnValidateCredentials As IPCValidateCredentialsEvent
    Public Delegate Sub IPCValidateCredentialsEvent(ByVal Sender As Object, ByVal Arg As IPCValidateCredentialsEventArgs)
    Public Class IPCValidateCredentialsEventArgs
        Public Message As IPCMessage
        Public Credentials As IPCMessageCredentials
        Public Valid As Boolean = True
    End Class

[Java]
    public interface ValidateCredentialsListener extends EventListener {
        public boolean ValidateCredentials(ValidateCredentialsEvent e);
    }     public class ValidateCredentialsEvent extends EventObject {
        public IPCMessage getMessage();
        public IPCMessageCredentials 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 IPCMessage getMessage();
        public IPCMessageCredentials getCredentials();
    }
    void addValidateCredentialsListener(ValidateCredentialsListener l);
    void removeValidateCredentialsListener(ValidateCredentialsListener l);

[DLL]
    void __stdcall IPCMessengerSetOnValidateCredentials(HIPCMessenger h, ValidateCredentialsProc Code, long UserData);
    void __stdcall IPCMessengerGetOnValidateCredentials(HIPCMessenger h, ValidateCredentialsProc* Code, long* UserData);
    __stdcall void (*ValidateCredentialsProc)(long UserData, HIPC Reserved, IPCMessage Message, IPCMessageCredentials* 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).