[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

using msxml.dll from vc++

Posted on 2000-03-21
8
Medium Priority
?
782 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 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
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.

 
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
Loops Section Overview
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month19 days, 7 hours left to enroll

873 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