Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Loading Mqrt.dll via LoadLibrary call

3 views
Skip to first unread message

Ashley Barton

unread,
Apr 13, 2004, 5:22:05 PM4/13/04
to
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

Doron Juster [MSFT]

unread,
Apr 13, 2004, 7:37:20 PM4/13/04
to
Using mqrt via LoadLibrary should work ok. Can you please post sample code
which demonstrate how this fails ?

Thanks, Doron
--
This posting is provided "AS IS" with no warranties, and confers no rights.
.

"Ashley Barton" <abar...@yahoo.com> wrote in message
news:eNSXt0ZI...@TK2MSFTNGP11.phx.gbl...

Ashley Barton

unread,
Apr 14, 2004, 12:53:09 PM4/14/04
to
Thanks for the response. In my effort to put together a code sample, I
figured out what the problem was. The project I was using MSMQ in was using
function calling convention __cdecl. My function pointer definitions had
not been prefixed with __stdcall, so the problem was created by using two
different calling conventions. When I created the new project for the
sample code the /GZ compiler switch was on, which alerted me to the problem.

"Doron Juster [MSFT]" <Dor...@online.microsoft.com> wrote in message
news:Oek6CBb...@tk2msftngp13.phx.gbl...

0 new messages