【问题标题】:map/set iterator not dereferencable映射/设置迭代器不可取消引用
【发布时间】:2013-10-05 07:49:17
【问题描述】:

问候

我使用boost ptree 来获取一些信息,也需要一段时间。

typedef ptree MInfo;

在我的应用程序中,我使用以下样式将.put.get 信息输入我的MInfo

a_info.put<WORD>(PathTree(SStatus)(fwDevice).str(), s_status->fwDevice);

WORD y = a_info.get<WORD>(PathTree(SStatus)(fwSensors)(S_SWITCH).str());

在我的新方法中,我使用相同的结构将信息放在我的 ptree 上以便稍后获取。

HRESULT SBase::getPortStatusEvent(AInfo &a_info, LPARAM lParam)
{
    ...

    using namespace boost::property_tree;

    a_info.put<WORD>(PathTree(SEvent)(wPortType).str(), port_Status->wPortType);      //This Line Cause the Error!!
    a_info.put<WORD>(PathTree(SEvent)(wPortIndex).str(), port_Status->wPortIndex);    //This Line Cause the Error!!
    a_info.put<WORD>(PathTree(SEvent)(wPortStatus).str(), port_Status->wPortStatus);  //This Line Cause the Error!!

    ....

    return WFS_SUCCESS;
}

a_info.put 出现错误。

有什么想法吗?!

【问题讨论】:

    标签: multithreading visual-c++ boost ptree


    【解决方案1】:

    问题是将此部分映射到实际的字符串路径。

    PathTree(SEvent)(wPortType).str()
    

    我自己想办法处理!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-23
      • 2015-01-13
      • 1970-01-01
      相关资源
      最近更新 更多