![]() |
CXTPPropExchangeXMLNode What am i doing wrong |
Post Reply ![]() |
Author | |
schwinn ![]() Groupie ![]() ![]() Joined: 17 April 2009 Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() Posted: 29 November 2012 at 11:44am |
uploads/5155/Experiments.zip
Hi All
What am i doing wrong?
I cannot get my code to read the attributes within my Experiment Nodes. I have included my XML file and here is my code. Any help please but not to suggest the sample application because this has a parent Node called Item and its child nodes are called Item.
So my code is....
BOOL StandardTreeCtrlDlg::OnInitDialog()
{ CDialogEx::OnInitDialog(); CXTPPropExchangeXMLNode px(TRUE, 0, _T("ExperimentExplorer")); // To serialize to XML file
if (px.LoadFromFile(L"C:\\Experiments.xmlw")) { HTREEITEM hItem = m_Tree.InsertItem(_T("My Experiments"), 0, 0);
CXTPPropExchangeSection sec(px.GetSection(_T("Experiments")));
DoExchangeTree(&sec, hItem); } return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE } void StandardTreeCtrlDlg::DoExchangeTree(CXTPPropExchange* pPX, HTREEITEM hItemRoot) { if (pPX->IsStoring())
{ }
else { CXTPPropExchangeEnumeratorPtr pEnumerator(pPX->GetEnumerator( _T("Experiment"))); POSITION pos = pEnumerator->GetPosition(0); while (pos) { CString strText; PX_String(pPX, _T("Name"), strText); // gets nothing CXTPPropExchangeSection sec(pEnumerator->GetNext(pos));
PX_String(pPX, _T("Name"), strText); // still gets nothing
HTREEITEM hItemChild = m_Tree.InsertItem(str, 0,0, hItemRoot);
DoExchangeTree(&sec, hItemChild);
} } } Thanks for any help
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |