Title: RE: ActiveX Object in VB

The length parameter is optional on the Get method and by not coding it the buffer for the incoming message is set to accomodate the whole message.  So you could, alternatively, not include the length and drop the Get Option for Accepting a Truncated Message.  This will still give you what you want and also access to the whole message, should you find it is needed.  All for less code too.

Regards,

Andy.

-----Original Message-----
From: Joshi, A (Anant) [mailto:[EMAIL PROTECTED]]
Sent: 31 May 2002 14:49
To: [EMAIL PROTECTED]
Subject: Re: ActiveX Object in VB


Hi,

The code is not doing destructive reads.

But your second point led me to the problem.

The mqq.CompletionCode was returning warning.
The reason was MQRC_TRUNCATED_MSG_FAILED.
In this case the browse cursor does not move.
By setting the mqgmo.Option to MQGMO_ACCEPT_TRUNCATED_MSG
(in addition to Browse of course), I do get all
messages on the queue.

I had set length to 0 in the get call
as I'm not interested in data.
All I needed was to present user with
list of messages with their Id and other details.

Thanks Steve and all others.

-----Original Message-----
From: GIES, STEVE [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 30, 2002 6:44 PM
To: [EMAIL PROTECTED]
Subject: Re: ActiveX Object in VB


Joshi -

Couple of things.  First, by not setting the mqgmo.Options =
MQGMO_BROWSE_NEXT anymore you are doing destructive gets against your queue
not browse gets.  Secondly, you are checking the CompletionCode of your
mqgmo object.  I think you want to check the mqq object.  This is the object
that will contain the CC from the get method.

- Steve

-----Original Message-----
From: Joshi, A (Anant) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 30, 2002 12:08 PM
To: [EMAIL PROTECTED]
Subject: Re: ActiveX Object in VB


I was getting MQ Error.
MQRC_NO_MSG_AVAILABLE.

I modified the code to set the MatchOption.

Now I do not get error but only first 3 iterations
bring in distinct message IDs. From there, I keep
getting third message in an infinite loop.

Thanks for help.

======== Code Begin
    Done = False

        Set mqmsg = Nothing
        Set mqgmo = Nothing
        Set mqmsg = New MQMessage
        Set mqgmo = New MQGetMessageOptions

    mqgmo.MatchOptions = MQMO_NONE

    Do

        mqq.Get mqmsg, mqgmo, 0

        Counter = Counter + 1

        If mqgmo.CompletionCode = MQCC_OK Then
            lstMessages.AddItem Counter & vbTab & mqmsg.MessageId
            'lstMessages.AddItem Counter & vbTab & mqmsg.PutDateTime
        Else
            Done = True
        End If

        mqmsg.MessageId = ""
        mqgmo.ClearErrorCodes

    Loop Until Done

========== Code End

-----Original Message-----
From: Ryan Parmenter [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 30, 2002 3:03 PM
To: [EMAIL PROTECTED]
Subject: Re: ActiveX Object in VB


What error are you getting?  Is it a VB error or an MQ error?

Ryan

>>> [EMAIL PROTECTED] 05/30/02 10:11AM >>>
Hi

I'm trying to display list of messages with their PutDateTime in a List Box
in VB using following code.

======== Code Begin
    Do
        If Counter = 0 Then
            mqgmo.Options = MQGMO_BROWSE_FIRST
        Else
            mqgmo.Options = MQGMO_BROWSE_NEXT
        End If

        mqq.Get mqmsg, mqgmo, 0

        Counter = Counter + 1

        If mqgmo.CompletionCode = MQCC_OK Then
            lstMessages.AddItem Counter & vbTab & mqmsg.PutDateTime
        Else
            Done = True
        End If

    Loop Until Done

======== Code End

However, I get error when loop iterates second time. PutDateTime of first
message is read correctly.

Any ideas?

Thanks in Advance

==================================================================
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is
uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht
ontvangt wordt u verzocht de inhoud niet te gebruiken en de afzender direct
te informeren door het bericht te retourneren.
==================================================================
The information contained in this message may be confidential and is
intended to be exclusively for the addressee. Should you receive this
message unintentionally, please do not use the contents herein and notify
the sender immediately by return e-mail.


==================================================================

Instructions for managing your mailing list subscription are provided in the
Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive

==================================================================
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is
uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht
ontvangt wordt u verzocht de inhoud niet te gebruiken en de afzender direct
te informeren door het bericht te retourneren.
==================================================================
The information contained in this message may be confidential and is
intended to be exclusively for the addressee. Should you receive this
message unintentionally, please do not use the contents herein and notify
the sender immediately by return e-mail.


==================================================================

Instructions for managing your mailing list subscription are provided in the
Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive

Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive

==================================================================
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en
is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht
onterecht ontvangt wordt u verzocht de inhoud niet te gebruiken en
de afzender direct te informeren door het bericht te retourneren.
==================================================================
The information contained in this message may be confidential
and is intended to be exclusively for the addressee. Should you
receive this message unintentionally, please do not use the contents
herein and notify the sender immediately by return e-mail.


==================================================================

Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive



-----------------------------------------------------------------------------------------------------------------------
This e-mail is intended only for the above addressee. It may contain
privileged information. If you are not the addressee you must not copy,
distribute, disclose or use any of the information in it. If you have
received it in error please delete it and immediately notify the sender.

evolvebank.com is a division of Lloyds TSB Bank plc.
Lloyds TSB Bank plc, 71 Lombard Street, London EC3P 3BS. Registered in
England, number 2065. Telephone No: 020 7626 1500
Lloyds TSB Scotland plc, Henry Duncan House, 120 George Street,
Edinburgh EH2 4LH. Registered in Scotland, number 95237. Telephone
No: 0131 225 4555

Lloyds TSB Bank plc and Lloyds TSB Scotland plc are regulated by the
Financial Services Authority and represent only the Scottish Widows
and Lloyds TSB Marketing Group for life assurance, pensions and
investment business.

Signatories to the Banking Codes.
-----------------------------------------------------------------------------------------------------------------------

Reply via email to