Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

using msxml.dll from vc++

Posted on 2000-03-21
8
Medium Priority
?
779 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 100 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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, …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

636 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