Solved

using msxml.dll from vc++

Posted on 2000-03-21
8
754 Views
Last Modified: 2008-03-17
Hi all:

Can anyone help me with a simple
vc++ sample code that uses the
msxml parser...   would be very
appreciative....

didou.
0
Comment
Question by:didou
8 Comments
 
LVL 27

Expert Comment

by:BigRat
ID: 2642124
You might try
http://www.microsoft.com/Mind/0798/XML.HTM
but it might be a bit too much. In any event you can class wrap the ActiveX object and call the methods documented for automation (ie: use the ASP/JScript samples).
0
 
LVL 1

Accepted Solution

by:
cwgues earned 50 total points
ID: 2645141
I used this reference as it was the most informative.......  The source is very clear and concise.....


http://msdn.microsoft.com/community/c-frame.htm#/community/peerjournal/

XML

Reading and Writing XML files with VC++
0
 

Author Comment

by:didou
ID: 2645476
friends:

actually all i need is a simple
c++ code example that shows me how,
given an xml document, i can use the
msxml.dll that comes with ie 5 to
extract information from my xml file.

thanks,
didou

0
 
LVL 27

Expert Comment

by:BigRat
ID: 2646344
I can understand your frustration. I'm also a C++ programmer. But the msxml ActiveX component which comes with IE 5 (or can be downloaded form almost anywhere) is specifically designed to be used as an automation object and consequently all the examples I have seen are VB examples. So I had to either use it via Automation in C++, or class wrap the thing, or use it in VBA. The latter I chose, since it was actually simpler! I'm sorry I can't help you further. C++ programmers may become a dying breed.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Expert Comment

by:cwgues
ID: 2646491
If you download and read the artical I have pointed to you will have a C++ code example.  It is a very simple example and it shouldn't take too long to get to grips with it.  It is too big and pointless to upload the code here.

http://msdn.microsoft.com/community/c-frame.htm#/community/peerjournal/ 

XML  <section>

Reading and Writing XML files with VC++




0
 
LVL 27

Expert Comment

by:BigRat
ID: 2646767
I didn't want to say this before, cwques, but since you have quoted it twice, I get "The page you're looking for has been moved or removed from the site" when I click your link.
0
 
LVL 1

Expert Comment

by:cwgues
ID: 2646869
Sorry,

If you goto

http://msdn.microsoft.com/peerjournal/

Click on show TOC

Click on XML in the sideframe

You will now see

Reading and Writing XML files with VC++


This definately is there...
0
 

Expert Comment

by:MurRaj
ID: 2737065
hi didou,

Hope this might help you out..
it has worked for me

IXMLDOMDocument xmldoc;
CString str="c:\\portfolio.xml";
VARIANT fname;
fname.vt=VT_BSTR;
fname.bstrVal=str.AllocSysString();
OleInitialize(NULL);  

//Create an instance of XMLDOM object
CString ProgID("Microsoft.XMLDOM.1.0");
try
{
xmldoc.CreateDispatch(ProgID,NULL);
}
catch(CException *e)
{
  OleUninitialize();
}
if (xmldoc.load(fname))
{
xmlnode = xmldoc.GetDocumentElement();
if(xmldoc.hasChildNodes)
{
node1 = xmlnode.GetFirstChild();
while (node1 != NULL)
{
if(node1.hasChildNodes)
{
node2=node1.GetFirstChild();
while (node2 != NULL)
{
///////////
AfxMessageBox(node2.GetNodeName());
AfxMessageBox(node2.GetText());
///////////
node2=node2.GetNextSibling();
}
}
///////////
AfxMessageBox(node1.GetNodeName());
AfxMessageBox(node1.GetText());
///////////
node1=node1.GetNextSibling();
}
}
}

This is a sample for you...
if you can give me your mail id ..i will send you the sample portfolio.xml..by which you can test this sample..

bye good luck..
Murali
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
router and equipment 3 79
RSS Feed Validation 2 58
Extract XML data and load into database (possible approaches) 5 34
[PHP] Hash a XML file/string 3 65
The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now