Click here to Skip to main content
14,734,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am working with windows registry.

Added the .xml file path to the windows registry like this " RegSetValueEx(HKEY_CURRENT_USER, "", 0, REG_SZ, (const BYTE*)"D:\\facedata.xml", 512);"

Now i want to read all the contents of .xml file and store in to some variable.

I had been surfing through the net from sometime on these registry.

Any Ideas for reading the contents from .xml file.

Thanks in advance.
Posted

1 solution

Reading the contents of an XML file has nothing to do with the registry.
However, since you're storing the path to the file in the registry, you can use the RegQueryValueEx function to first read the file path into a variable.

To simply read the contents of the file and store to a variable, you can use the CreateFile and ReadFile APIs.
However, if you want to parse the XML and manipulate it, you need to use the XML Document Object Model (DOM).
You could start here - A Beginner's Guide to the XML DOM[^]
   
Comments
   
Right, a 5. Also, I would note that using CodeDOM is good only for relatively small documents. There is SAX parsing and a lot more...
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900