|
-
December 1st, 2002, 11:28 PM
#1
how to use XmlDocument in C++?
Code:
#using <System.Xml.dll>
using namespace System::Xml;
namespace abc {
class abc
{
virtual XmlDocument* GetXmlDocument(CFile file);
}}
have error:
d:\Visual Studio Projects\abc\abc.h(85): error C3383: abc::abc::GetXmlDocument' : in an unmanaged class, a virtual member function cannot have a managed type in the signature
how do i create and use an XmlDocument. Regex and other .net functions in C++? specifically, i wanna use these functions in emule
-
December 2nd, 2002, 04:53 PM
#2
Hi
If you paste this code in a new C++ Managed Application Project
it will show you the name of the of the first Node.
Good Luck.
Kamal
// This is the main project file for VC++ application project
// generated using an Application Wizard.
#include "stdafx.h"
#using <mscorlib.dll>
#include <tchar.h>
#using <System.dll>
#using <System.xml.dll>
using namespace System;
using namespace System::Xml;
__gc class CXMLReader
{
public:
XmlDocument* GetXmlDocument(String* fileName);
};
XmlDocument* CXMLReader::GetXmlDocument(String* fileName) //fileName must include fully qualified path
{
XmlDocument* doc = new XmlDocument();
doc->Load(fileName);
return doc;
}
// This is the entry point for this application
int _tmain(void)
{
// TODO: Please replace the sample code below with your own.
CXMLReader* rdr = new CXMLReader();
XmlDocument* doc = rdr->GetXmlDocument(S"D:\\VC++ Projects\\Test1\\test1.xml");
Console::WriteLine(doc->FirstChild->Name);
return 0;
}
-
December 4th, 2002, 03:41 AM
#3
Originally posted by mkamal
Hi
If you paste this code in a new C++ Managed Application Project
it will show you the name of the of the first Node.
Good Luck.
Kamal
thanks, but i wanted to use XmlDocument in emule, which is a unmanaged project. converting it to managed will be a ****
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|