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
中得到錯誤。
任何想法?!