At which line do you receive an error? I would expect it to be in the
MQ_OPEN, which you do not supply, and should be executed in front of
mq_setOptions(). We also cannot see from here what your MQP_OPTIONS values
are, nor much else of importance. (Did you connect? How did you connect?
What is the queue name? et cetera)
I am used to the functions that are a product of the #include "cmqc.h"
directive, and these include such functions as MQCONN, MQOPEN, MQPUT, et
cetera, rather than names like mq_setOptions(). I am also used to seeing
tests for success/failure, which appear to be lacking in the supplied
I could probably get past the difference in function names, but what I see
here - sorry - is not enough detail. So I will suggest that you add an
error test after *every* MQ call (religiously) and determine the cause for
failure at the point of failure. Possibly what's happening here is that the
CONN failed (or the OPEN) but you didn't know it... then you tried to use
the resultant handle, and that usage failed. But that is a wild guess.
"I shall make electricity so cheap that only the rich can afford to burn
-- Thomas Edison