C++ boost::进程间::消息队列构造函数失败

C++ boost::进程间::消息队列构造函数失败,c++,boost,boost-interprocess,C++,Boost,Boost Interprocess,boost::进程间::消息队列构造函数在不同用户下运行进程时失败。 更具体一些。我正在proc1中创建消息队列。并尝试从proc2(另一个用户)打开相同的消息队列。 有可能使它工作吗?或者我应该找到另一种方法来同步我的进程 boost-1.52 操作系统:Windows 7 x86 编译程序:MSVC 2010 另外,代码很简单。如果两个进程都是从同一个用户启动的,则可以完全正常工作 这是我的留言框。我无法调用LastWindowError() (进程2的)我的代码: void ipcMsg1

boost::进程间::消息队列构造函数在不同用户下运行进程时失败。
更具体一些。我正在proc1中创建消息队列。并尝试从proc2(另一个用户)打开相同的消息队列。
有可能使它工作吗?或者我应该找到另一种方法来同步我的进程

boost-1.52
操作系统:Windows 7 x86
编译程序:MSVC 2010

另外,代码很简单。如果两个进程都是从同一个用户启动的,则可以完全正常工作

这是我的留言框。我无法调用LastWindowError()

(进程2的)我的代码:

void ipcMsg1(HWND-HWND){
util::MsgBox mb(hWnd,L“发送消息1”);
试一试{
mb.info(L“创建mq”);
bipc::message_queue mq(bipc::open_或_create,plmqproto::g_mqName,plmqproto::g_mqSize,sizeof(int));
mb.信息(L“已创建”);
const int msg=plmqproto::g_mqMessage1;
mq.send(&msg,sizeof(msg),0);
bipc::message_queue::remove(plmqproto::g_mqName);
}catch(常量bipc::进程间异常&ex){
错误(plcore::stringToWString(例如what());
std::wstringstream ss;
const unsigned long we=GetLastError();
ss GetLastError()返回什么?我猜是“5”。
---------------------------
Error
---------------------------
Runtime Error (at 18:421):



External exception E06D7363.
---------------------------
ОК   
---------------------------
   void ipcMsg1(HWND hWnd) {
    util::MsgBox mb(hWnd, L"Sending Message1");
    try {
        mb.info(L"create mq");
        bipc::message_queue mq(bipc::open_or_create, plmqproto::g_mqName, plmqproto::g_mqSize, sizeof(int));
        mb.info(L"created");
        const int msg = plmqproto::g_mqMessage1;
        mq.send(&msg, sizeof(msg), 0);
        bipc::message_queue::remove(plmqproto::g_mqName);
    } catch(const bipc::interprocess_exception &ex) {
        mb.error(plcore::stringToWString(ex.what()));
        std::wstringstream ss;
        const unsigned long we = GetLastError();
        ss << L">1. GetLastError: " << we << std::endl;
        ss << L" " << plcore::GetWindowsErrorMessage(we); 
        mb.error(ss.str());
    } catch(const std::exception &ex) {
        mb.error(plcore::stringToWString(ex.what()));
        std::wstringstream ss;
        const unsigned long we = GetLastError();
        ss << L">2. GetLastError: " << we << std::endl;
        ss << L" " << plcore::GetWindowsErrorMessage(we); 
        mb.error(ss.str());
    } catch(...) {
        std::wstringstream ss;
        const unsigned long we = GetLastError();
        ss << L">3. GetLastError: " << we << std::endl;
        ss << L" " << plcore::GetWindowsErrorMessage(we); 
        mb.error(ss.str());
    }
}