2013-10-05 60 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() 

我制定了自己的方法來處理它!