473,322 Members | 1,232 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

how can I acess XML file in Managed C++ application

I wanna write an application using xml technology with MS.NET2003
VC++.NET,but I don't know how to add xml functionality to my application, So
anybody can offer same artical or snipped codes?

Thank for your the advanced.

Best regards.
Allen Zhang
Nov 17 '05 #1
1 2429
On Tue, 25 May 2004 10:28:13 +0800, allen chang wrote:
I wanna write an application using xml technology with MS.NET2003
VC++.NET,but I don't know how to add xml functionality to my application, So
anybody can offer same artical or snipped codes?

Thank for your the advanced.


Here's a snippet from my test program. Hopefully you get the idea.

#using <mscorlib.dll>
#using <System.Xml.dll>

using namespace std;
using namespace LX;
using namespace System::Xml::Serialization;
using namespace System::Xml;
using namespace System;
using namespace System;
using namespace System::Collections;

public __gc class foo
{
public:
foo()
{
}

foo(System::String* s)
{
_s = s;
}
public:
[XmlAttributeAttribute(S"name")]
System::String* _s;
};

public __gc class land_xml
{
public:
land_xml()
{
arr = new System::Collections::ArrayList();
m_collection = new GeoPointBaseCollection();
System::String* s = new System::String("Daniel");
m_collection->Add(s);
}

public:
[XmlArray(S"Alignments")]
[XmlArrayItemAttribute(S"Alignment",__typeof(foo))]
System::Collections::ArrayList* arr;

[System::Xml::Serialization::XmlAttributeAttribute( "Alignments")]
GeoPointBaseCollection* m_collection;
};

int test()
{
using namespace System;
using namespace System::Xml;
using namespace System::Xml::Serialization;
using namespace System::IO;

land_xml* m_land_xml = new land_xml();
XmlSerializer* xs = new XmlSerializer(__typeof(land_xml));
XmlTextWriter* writer = new XmlTextWriter("land_xml2.xml",
System::Text::Encoding::UTF8);
writer->Formatting = Formatting::Indented;
xs->Serialize(writer, m_land_xml);
writer->Close();
return 0;
}

--
Daniel
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rajesh R. | last post by:
Hi, I have developed an application in asp with backend as ms-access database. The mdb file is on a one machine and my IIS is running on a different machine. The code which I tried is as follows...
2
by: Dave | last post by:
Hi, I am writing a c# application that using a directshow to play file and display it on my C# gui, its work just fine but when i try to open another thread in my c# application the file stop...
1
by: Jordi | last post by:
Hi, I have a problem when accesing data with and ODBC provider under asp.Net applications. The question is that if I run the application in the same server where data is stored then data is...
0
by: Pk | last post by:
Hi, I want to download and upload the data from acess database into excel file or from excel to database. So how can i use "Excel.Application" to do this type of job. So please help me soon. ...
6
by: Mukesh | last post by:
Hi I have Microsoft Enterprise Library 2005 installed on my local system. I m also using ASp.net 1.1 And C3 as coding language , I have MS Sql Server 2000. I am developing a web application...
3
by: Mukesh | last post by:
Hi all As per my earlier conversation with Ciaran (thx for reply) I have installed the MS APplication block on the server , when i ran Build Enterprise Library file and Install Services from...
1
by: Sarwan | last post by:
Hello everybody I have a solution in which there is an unmanaged MFC application. Then i added a new managed .Net Windows Form application. I was trying to refer an header file of unmanaged...
0
by: sangram24 | last post by:
Hi everybody i want Acess the outlook express inbox in my asp.net application so tell me the links or code if possible tell me how to from the object of the outlook express so i can...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.