Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost-Users][interprocess]ERROR_ACCESS_DENIED when removing a message_queue
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-04-07 11:42:55


AMDG

Laurence Chambenois wrote:
> but if it does :
>
> message_queue *mq1=0;
>
> try
> {
> mq1 = new message_queue(create_only, "toto", 10, 100);
> }
> catch (interprocess_exception &err)
> {
> return -1;
> }
>
> message_queue::remove("toto");
>
>
> then the remove return ERROR_ACCESS_DENIED (on tthe DeleteFile call).
> I don't understand why. Is somebody can tell me what is wrong with my
> code ?

I suspect that the problem is that in the second case you are trying to
remove a message queue which you still have a handle to. In the
first case, mq1 goes out of scope.

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net