Click here to Skip to main content
15,886,004 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am fetching system information with vc++.. I want to store my output in xml file. How should I do it? I have included my VC++ code below. Which xml library/headerfile/namespace should I include to achieve it ?

Thanks,

Regards

C++
#include "stdafx.h"
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include <iostream>


public class TEST2
{
public:
void WindowsVersion()
{
 DWORD dwWinVer;
 dwWinVer = GetVersion();


 _tprintf ( _T("Windows version: %d.%d.%d"),
            LOBYTE(LOWORD(dwWinVer)), HIBYTE(LOWORD(dwWinVer)),  // LoWord
            HIWORD(dwWinVer));

}
void processinfo()
{
        SYSTEM_INFO sysInfo;
    GetSystemInfo(&sysInfo);
_tprintf( _T("\n Number of processs is running on %d"),
sysInfo.dwNumberOfProcessors);//process ketli chale che

}};
int main()
{

TEST2 t2;

t2.WindowsVersion();
t2.processinfo();


  system("pause");
   return 0;

}
Posted
Updated 25-Mar-14 2:07am
v2

You can use the XmlLite library[^] to store your data as XML.
 
Share this answer
 
Comments
chandanadhikari 25-Mar-14 8:00am    
5! i was reading about this the other day .. just skipped my mind while answering. hope the asker is good with COM though :)
hi,
see this question's solutions :
Create and parse XML file in Visual C++[^]
And this helpful article http://msdn.microsoft.com/en-us/library/ms767611(v=vs.85).aspx[^]

Or just just check if boost library can help you here (Google for XML creation with boost)
Otherwise
cereal[^] and ticpp[^]
are also good.
 
Share this answer
 
@wong-shao-voon has written a couple of articles on XML. I especially like The XML Parsing Article That Should (Not) Be Written![^] and Portable Elmax[^]. He also wrote Linq-To-XML Style of Node Creation for C++[^] which I have not tried yet.
 
Share this answer
 

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