Author |
Message
|
cliao |
Posted: Wed Oct 06, 2004 6:04 am Post subject: sample for browsing message in vb.net |
|
|
Novice
Joined: 08 Sep 2004 Posts: 23
|
Can someone give me an example on how to browsing message in vb.net?
thanks,
Lei |
|
Back to top |
|
 |
vennela |
Posted: Wed Oct 06, 2004 8:30 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
I don't know any VB. But if you have installed MQ or MQ client then there will be sample programs in the directory
<MQ Install Directory>\Tools\VB\SampVB6
For me it is
C:\Program Files\IBM\WebSphere MQ\Tools\Vb\sampVB6
The program you should be looking at starts with amqsbcg
I don't know the which one of them is source code but I have these files
Code: |
amqsbcgb.frm
amqsbcgb.frx
amqsbcgb.vbp |
|
|
Back to top |
|
 |
JasonE |
Posted: Wed Oct 06, 2004 8:37 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
There isnt any .net *bcg equivalents shipped (\mqm\Tools\dotnet\samples\vb)
VB is not equal to vb.net |
|
Back to top |
|
 |
kevinf2349 |
Posted: Wed Oct 06, 2004 9:47 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Take a look in
C:\Program Files\IBM\WebSphere MQ\Tools\VB\sampVB6\pcfsamp.NET
That gives some PCF command examples but you should be able to work it out from there.
If that doesn't give you any help try manual WebSphere MQ Using .Net (GC34-6328-02) it gives some examples for you. |
|
Back to top |
|
 |
cliao |
Posted: Wed Oct 06, 2004 10:41 am Post subject: |
|
|
Novice
Joined: 08 Sep 2004 Posts: 23
|
This is what I have,
objQueue = objQMgr.AccessQueue(strQname, MQC.MQOO_BROWSE + MQC.MQOO_FAIL_IF_QUIESCING)
Dim mqMsg As MQMessage '* MQMessage instance
Dim mqGetMsgOpts As MQGetMessageOptions '* MQGetMessageOptions instance
mqMsg = New MQMessage
mqGetMsgOpts = New MQGetMessageOptions
mqGetMsgOpts.WaitInterval = 15000 '* 15 second limit for waiting
Try
objQueue.Get(mqMsg, mqGetMsgOpts) ---- this is the line failed
what do I need to change?
Thanks,
Lei |
|
Back to top |
|
 |
kevinf2349 |
Posted: Wed Oct 06, 2004 10:50 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Try putting this line in after the :
mqGetMsgOpts = New MQGetMessageOptions
getTMopts.Options = MQC.MQGMO_NO_SYNCPOINT + MQC.MQGMO_CONVERT + MQC.MQGMO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING
If that doesn't work please give us a clue by telling us what the error message is.  |
|
Back to top |
|
 |
vennela |
Posted: Wed Oct 06, 2004 11:35 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
For a browse :
getTMopts.Options = MQC.MQGMO_NO_SYNCPOINT + MQC.MQGMO_CONVERT + MQC.MQGMO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING + MQC.MQGMO_BROWSE_NEXT |
|
Back to top |
|
 |
cliao |
Posted: Wed Oct 06, 2004 12:48 pm Post subject: |
|
|
Novice
Joined: 08 Sep 2004 Posts: 23
|
Thank you for all your information. Now I can browse the messages in the queue.
Thanks for the help.
Lei |
|
Back to top |
|
 |
|