Solved

using msxml.dll from vc++

Posted on 2000-03-21
8
750 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 1

Expert Comment

by:cwgues
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
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, …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

10 Experts available now in Live!

Get 1:1 Help Now