Discuss this help topic in MsgConnect Forum

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



Messenger.PeekMessageEx

Messenger     See also    


Returns an incoming message with specified destination queue name and leaves it in the queue.

Declaration

[C++]
    bool PeekMessageEx(const char* QueueName, MCMessage* Message);

[Pascal]
    function PeekMessageEx(string QueueName, var Message : TMCMessage) : boolean;

[VB6]
    Function PeekMessageEx(QueueName As String, Message As IMCXMessage) As Boolean

[ActiveX]
    HRESULT _stdcall PeekMessageEx([in] BSTR QueueName, [out] IMCXMessage ** Message, [out, retval] VARIANT_BOOL * res);

[C#]
    public bool PeekMessageEx(string QueueName, ref MCMessage Message);

[VB.NET]
    Public Function PeekMessageEx(QueueName As String, ByRef Message As MCMessage) As Boolean

[Java]
    public boolean PeekMessageEx(String queueName, MCMessage message);

[Java ME]
not available;

[DLL]
    long __stdcall MCMessengerPeekMessageEx(const char* QueueName, HMCMessenger h, MCMessage* Message, bool* res);

Parameters

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

  • QueueName - The name of the queue, to which the message has arrived
  • Message - The structure that PeekMessageEx places all message data to. See more here
  • res - result of method execution (see Return value for details)

Return value

    True if the message was found and false if there was no incoming message waiting for handing
[DLL]
    Return value is passed via res parameter.
    MC_OK is always returned.

Description

    Call this method to peek the message from the input queue. This method returns immediately, returning the value that lets you determine whether there was a message in the queue. Upon return the message is NOT marked as being processed and the next call to PeekMessageEx will return the same message.
    Once the message was processed, the application must call MessageProcessed method to let the Messenger send reply (if necessary) and cleanup internal records.
    This method together with GetMessage and MessageProcessed is an alternative to using Queues.

See also:     Queue class     MCMessage structure     GetMessage     MessageProcessed    

Discuss this help topic in MsgConnect Forum