Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-03-23
3
Medium Priority
?
329 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

719 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