ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » How to acess USER DATA field in Process Definition

Post new topic  Reply to topic
 How to acess USER DATA field in Process Definition « View previous topic :: View next topic » 
Author Message
sebastia
PostPosted: Mon Jun 26, 2006 7:15 am    Post subject: How to acess USER DATA field in Process Definition Reply with quote

Grand Master

Joined: 07 Oct 2004
Posts: 1003

I have a Process Definition where I wrote
User Data := "ABCDEF" ;

My code gets control (writes to a file at "c:\")

But when I try
+++
iCnt = 0 ;
while ( iCnt < argc ) {

sprintf ( MyDbg_Buffer, "Arg (%d) = (%s).", iCnt+1, argv[ iCnt ] ) ;
myTrace ( Trace_log_stream, MyDbg_Buffer ) ;
iCnt ++ ;
} ; /* endwhile */
+++

It starts ok ... writing
"(17:10:0 Argument count (2)."
then first param is displayed ok :
"(17:10:0 Argument (1) = (e:\sebas\TrigCode\mycode.exe)."

but then (at 2nd Argument) I get an error saying

-------------------------------------------------
The instruction at "0x00402d30" referenced memory at "0x01202030".
The memory could not be "read".
-------------------------------------------------

Any clue ?
The pointer "0x01202030" does look suspicious, but I have no idea on what could it point to .... and how to treat it ....

MQTMC2 ???

*************************************

Programming Reference (v 5.3) says :

The meaning of UserData is determined by the trigger-monitor application. The trigger monitor provided by MQSeries simply passes UserData to the started application as part of the parameter list. The parameter list consists of the MQTMC2 structure (containing UserData), followed by one blank, followed by EnvData with trailing blanks removed.

*************************************
Back to top
View user's profile Send private message Visit poster's website
Vitor
PostPosted: Mon Jun 26, 2006 7:28 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

argv(1) is, as you intimate, an MQTMC2 structure which I think will cause problems if you just try and sprintf it as a string.

You get to the UserData like you would any other structure element.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
sebastia
PostPosted: Mon Jun 26, 2006 10:21 am    Post subject: Reply with quote

Grand Master

Joined: 07 Oct 2004
Posts: 1003

Thanks Vitor - you were right.
Dont ask me why, but SPRINTF did not like the MQTMC2 sturcture.

With a simple typecast, all displays fine :

Best luck.

********************************************

ptrMQTMC2 = (PMQTMC2) argv [ 1 ] ; // type cast.

sprintf ( MyDbg_Buffer, "StructID (%.4s)", ptrMQTMC2 -> StrucId ) ;
mTraza ( Trace_log_stream, MyDbg_Buffer ) ;

sprintf ( MyDbg_Buffer, "Version (%.4s)", ptrMQTMC2 -> Version ) ;
mTraza ( Trace_log_stream, MyDbg_Buffer ) ;

sprintf ( MyDbg_Buffer, "Triggered queue (%.48s)", ptrMQTMC2 -> QName ) ;
mTraza ( Trace_log_stream, MyDbg_Buffer ) ;

sprintf ( MyDbg_Buffer, "Process name (%.48s)", ptrMQTMC2 -> ProcessName ) ;
mTraza ( Trace_log_stream, MyDbg_Buffer ) ;

sprintf ( MyDbg_Buffer, "Trigger Data (%.64s)", ptrMQTMC2 -> TriggerData ) ;
mTraza ( Trace_log_stream, MyDbg_Buffer ) ;

sprintf ( MyDbg_Buffer, "Application Type (%.4s)", ptrMQTMC2 -> ApplType ) ;
mTraza ( Trace_log_stream, MyDbg_Buffer ) ;

sprintf ( MyDbg_Buffer, "User Data (%.128s)", ptrMQTMC2 -> UserData ) ;
mTraza ( Trace_log_stream, MyDbg_Buffer ) ;
Back to top
View user's profile Send private message Visit poster's website
Vitor
PostPosted: Mon Jun 26, 2006 11:41 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

You're quite welcome.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » How to acess USER DATA field in Process Definition
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.