
Laurence Chambenois wrote:
It works fine, if my program does this : try { message_queue mq1(create_only, "toto", 10, 100); } catch (interprocess_exception &err) { return -1; }
message_queue::remove("toto");
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 ?
Just a wild guess: That's probably because the message queue is still open by the object mq1 points to. In the case where it works, mq1 is destroyed before the call to remove("toto").