Solved

MSMQ - Access rights problem on call to MQReceiveMessageByLookupId...

Posted on 2004-03-23
3
327 Views
Last Modified: 2012-06-27
Greetings,

    I am making the following call:

 // Peek at message with the given lookup identifier.
  hr = MQReceiveMessageByLookupId(
                                  hQueue,                // Handle of queue
                                  ullLookupId,           // Lookup identifier
                                  MQ_LOOKUP_PEEK_CURRENT // Access mode
                                  &msgProps,             // Message property structure
                                  NULL,                  // No OVERLAPPED structure
                                  NULL,                  // No callback function
                                  MQ_NO_TRANSACTION      // Not in a transaction
                                  );

 And receiving the following error:

 "The access rights of the queue for performing the action specified in dwLookupAction are not allowed for the user that opened the queue."

 The queue itself is a private queue accessed locally, and the security on it is setup such that full control is allowed by everyone and yet I still get this error... has anyone run into this problem? and if so how did they correct it? any help is appreciated. Btw, there are in fact 10 messages currently in the queue.

adgarcia13

PS: I have cross-posted this question in the Windows Programming topic area.
0
Comment
Question by:adgarcia13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 10668622
As I wrote in http://www.experts-exchange.com:8080/Programming/Programming_Platforms/Win_Prog/Q_20929696.html - you need to MQOpenQueue with the dwAccess parameter set to MQ_PEEK_ACCESS | MQ_ADMIN_ACCESS or MQ_RECEIVE_ACCESS | MQ_ADMIN_ACCESS along with local admin privileges.
0
 

Author Comment

by:adgarcia13
ID: 10671098

It looks like in fact I was not setting the dwAccess parameter to MQ_RECEIVE_ACCESS, Thanks. On a different note, what is the best approach for reading a message from Que1, writing it to Que2, and subsequently deleting the original message from Que1 once the write to Que2 is successful?

adgarcia13
0
 
LVL 86

Expert Comment

by:jkr
ID: 10678996
Well, as you cannot explicitly delete messages from a queue, you'd MQ_ACTION_PEEK_CURRENT on the msg you want to place in the other queue, 'MQSendMessage()' that one and the use MQ_ACTION_RECEIVE to remove the msg from the 1st queue...
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question