I'm using MSMQ 2.0 on Windows 2000 Server. I'm in the process of moving
from one message queuing system to MSMQ and plan to support both on a short
term basis for customer convenience. That being the case, some customers
will not have MSMQ installed on their system because they are using the
other message queuing system, and I would like to load mqrt.dll explicitly
via LoadLibrary() and get function pointers to all the MSMQ functions I will
be using only when MSMQ is to be used.
I have implemented this and I'm in the process of testing. The problem I am
having is when trying to cursor through messages in the queue using
MQReceiveMessage. The first call to this routine using
MQ_ACTION_PEEK_CURRENT works fine and returns the first message in the
queue. On each subsequent call to MQReceiveMessage using
MQ_ACTION_PEEK_NEXT or MQ_ACTION_RECEIVE, returns an error of
MQ_ERROR_INVALID_PARAMETER.
After checking everything in my code for errors and trying numerous
different approaches, I decided that I would change my code to link
implicitly to the mqrt.dll rather than explicitly. Once I made this change,
the MQReceiveMessage calls started to work correctly.
Does anyone know if there is a reason why mqrt.dll can't be loaded
explicitly to call MSMQ functions? Thanks.
Ashley Barton