0
我用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
中得到错误。
任何想法?!