Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPPropExchangeXMLNode What am i doing wrong
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPPropExchangeXMLNode What am i doing wrong

 Post Reply Post Reply
Author
Message
schwinn View Drop Down
Groupie
Groupie
Avatar

Joined: 17 April 2009
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote schwinn Quote  Post ReplyReply Direct Link To This Post Topic: CXTPPropExchangeXMLNode What am i doing wrong
    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
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.