Click here to Skip to main content
15,888,461 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to update a particular contol? Pin
Hamid_RT9-Oct-07 0:55
Hamid_RT9-Oct-07 0:55 
AnswerRe: How to update a particular contol? Pin
ram.Jaddu9-Oct-07 0:43
ram.Jaddu9-Oct-07 0:43 
AnswerRe: How to update a particular contol? Pin
ram.Jaddu9-Oct-07 1:21
ram.Jaddu9-Oct-07 1:21 
AnswerRe: How to update a particular contol? Pin
David Crow9-Oct-07 2:56
David Crow9-Oct-07 2:56 
QuestionCHAR or VARCHAR Pin
Try8-Oct-07 21:05
Try8-Oct-07 21:05 
AnswerRe: CHAR or VARCHAR Pin
Karismatic8-Oct-07 23:59
Karismatic8-Oct-07 23:59 
AnswerRe: CHAR or VARCHAR Pin
Mark Salsbery9-Oct-07 8:35
Mark Salsbery9-Oct-07 8:35 
QuestionXmlReader EOF property problem Pin
Shivian8-Oct-07 20:37
Shivian8-Oct-07 20:37 
Hi,

I'm writing some code to traverse an Xml document generated by XmlWriter. The document is extremely simple. It consists of a single element with a list of sub-elements storing some values as strings. I am having a problem using XmlReader to traverse the file to retrieve the results though.

I am running Visual Studio 2005 with .NET Framework 2.0.

Effectively what I want to do is to read each element, check a lookup table to see where to store the value associated with the element and move onto the next one. The problem is that I get a compile error when I attempt to use the EOF property.

<br />
int iRead;<br />
XmlReader ^xtr;<br />
xtr = XmlReader::Create(strFullPath);<br />
<br />
// Start traversing the list<br />
xtr->Read();<br />
<br />
while (!xtr->EOF) // THIS DOESN'T WORK!<br />
{<br />
  if ((xtr->NodeType == XmlNodeType::Element) && (xtr->Name == "AdminVal"))<br />
  {<br />
    iRead = xtr->ReadElementContentAsInt(); // store val and moves onto next node<br />
  }<br />
  // else if other cases here<br />
  else<br />
    xtr->Read(); // Move onto next node<br />
}<br />


Now the xtr->EOF does not work at all. It will not compile with it in place but if I replace it with a while(1) then it works 100% fine (except detecting the end of the list is a problem!). I know I can tell the end of the file state from the xtr->Read() return val but if the if statement is traversed, I do not get the opportunity to read the state.

The error listing is
error C2059: syntax error : '('
error C2143: syntax error : missing ';' before '{'
error C2039: 'xtr' : is not a member of 'System::Xml::XmlReader'
c:\windows\microsoft.net\framework\v2.0.50727\system.xml.dll : see declaration of 'System::Xml::XmlReader'

Is this a bug?

Thanks for any assistance!
AnswerRe: XmlReader EOF property problem Pin
User 5838528-Oct-07 20:49
User 5838528-Oct-07 20:49 
GeneralRe: XmlReader EOF property problem [modified] Pin
Shivian9-Oct-07 13:27
Shivian9-Oct-07 13:27 
GeneralRe: XmlReader EOF property problem [modified] Pin
ian__lindsay7-Feb-13 4:05
ian__lindsay7-Feb-13 4:05 
Questionmessage maps from derived class Pin
prithaa8-Oct-07 19:52
prithaa8-Oct-07 19:52 
AnswerRe: message maps from derived class Pin
Naveen8-Oct-07 19:58
Naveen8-Oct-07 19:58 
AnswerRe: message maps from derived class Pin
Jhony george9-Oct-07 1:08
Jhony george9-Oct-07 1:08 
QuestionProblem in SetWallpaper Pin
GauranG Shah8-Oct-07 19:05
GauranG Shah8-Oct-07 19:05 
AnswerRe: Problem in SetWallpaper Pin
Hamid_RT8-Oct-07 19:36
Hamid_RT8-Oct-07 19:36 
GeneralRe: Problem in SetWallpaper Pin
GauranG Shah8-Oct-07 20:31
GauranG Shah8-Oct-07 20:31 
GeneralRe: Problem in SetWallpaper Pin
aks.8-Oct-07 22:10
aks.8-Oct-07 22:10 
GeneralRe: Problem in SetWallpaper Pin
GauranG Shah8-Oct-07 22:45
GauranG Shah8-Oct-07 22:45 
GeneralRe: Problem in SetWallpaper Pin
aks.8-Oct-07 22:47
aks.8-Oct-07 22:47 
GeneralRe: Problem in SetWallpaper Pin
GauranG Shah8-Oct-07 22:53
GauranG Shah8-Oct-07 22:53 
GeneralRe: Problem in SetWallpaper Pin
aks.8-Oct-07 23:05
aks.8-Oct-07 23:05 
GeneralRe: Problem in SetWallpaper Pin
GauranG Shah8-Oct-07 23:12
GauranG Shah8-Oct-07 23:12 
QuestionRe: Problem in SetWallpaper Pin
David Crow9-Oct-07 3:08
David Crow9-Oct-07 3:08 
Questionhow to change the color of header of list control Pin
rajneshmalik8-Oct-07 18:55
rajneshmalik8-Oct-07 18:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.