2013-10-05 34 views
0

问候地图/套迭代器不dereferencable

我用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中得到错误。

任何想法?!

回答

0

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

PathTree(SEvent)(wPortType).str() 

我制定了自己的方法来处理它!