Firstly, your queue in the second like does not have the required "/" precursor.
If it were me, I'd do the following:
For the process which will be reading the MQ:
Code:
mqid = mq_open ("/h_queue",
O_CREAT | O_RDWR | O_EXCL | S_IRWXU | S_IRWXG | S_IRWXO,
0, NULL);
For the process which will be sending the message to that queue:
Code:
mqid = mq_open("/hqueue", O_WRONLY, 0, NULL);
-Aaron