I'm using boost::interprocess::message_queue for communication between processes. In one of them i use
::CoInitializeEx( 0, COINIT_MULTITHREADED );
to set up for COM calls. I cannot access any queues created after this call from the other process, or for that matter the same process but before the CoInit call.
I'm not terribly famililar with COM and their threading model, the CoInit call was added by a co-worker. What can I do to resolve this?
Here is a short snippet to illustrate:
boost::interprocess::message_queue m_queue1( boost::interprocess::open_or_create, "testqueue", 256, sizeof(int) );
::CoInitializeEx( 0, COINIT_MULTITHREADED );
boost::interprocess::message_queue m_queue2( boost::interprocess::open_only, "testqueue" );
In this example the second queue's constructor will throw an exception because it thinks the queue doesn't exist. If I remove the CoInit call it works fine.
EDIT: Boost version is 1.46.1. The call to CoInit in the snippet above returns S_OK.