2013-10-05 3 views
0

가 나는 또한 약간의 시간에 넣어 몇 가지 정보를 얻을 수 boost ptree를 사용 지도/설정 반복자는

인사말 dereferencable 없습니다. 내 응용 프로그램에서

typedef ptree MInfo; 

내가 내 MInfo.put 또는 .get 정보에 다음과 같은 스타일을 사용합니다. 나의 새로운 방법에서

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() 

나는 독자적으로 처리 할 수있는 방법을 만들었습니다.