Solved

using msxml.dll from vc++

Posted on 2000-03-21
8
765 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 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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

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, …
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 …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

730 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