Discussion:
How to migrate C++ code to MSXML 4
(too old to reply)
malhenry
2006-05-22 14:49:02 UTC
Permalink
Hi,

How does one migrate C++ code from MSXML 1.0 to version 4.0 ? I have
installed version 4.0, but I suspect my code is using version 1.0 or some
version prior to 4.0.
My stdafx.h file does contain the following lines:

// Microsoft DOM Control Support
#import "msxml.dll" named_guids raw_interfaces_only

Thanks.
Martin Honnen
2006-05-22 15:17:38 UTC
Permalink
Post by malhenry
How does one migrate C++ code from MSXML 1.0 to version 4.0 ? I have
installed version 4.0, but I suspect my code is using version 1.0 or some
version prior to 4.0.
// Microsoft DOM Control Support
#import "msxml.dll" named_guids raw_interfaces_only
The online MSXML SDK has some sections that should help, see
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/0f704b2c-a42f-4fca-aee3-bf66393e2db4.asp>
first for the different program ids and files that belong to the
different versions.
Then check
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/6976372b-9f4d-4d6f-91df-a6936b52c127.asp>
on how to use MSXML with C/C++.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
malhenry
2006-05-22 19:13:01 UTC
Permalink
My code is still not executing my query properly.
BSTR bstrQuery = ::SysAllocString( L"//Tra/incident[active='1'and city='TO'
and contains(event,'ollision')]" );

Here are the changes, that I made to my code:
1. change all occasions of MSXML:: to MSXML2::

2. change all occasions of IXMLDomDocument to IXMLDomDocument2

3. change:
#import "msxml.dll" named_guids raw_interfaces_only
to:
#import "msxml4.dll" named_guids raw_interfaces_only

However the following code returns XSLPattern:
pDoc->getProperty(bs, &Var);

I thought that version 4.0 default was XPath?
What else do I need to change in my code to make it use MSXML ver 4.0 ??

Thanks.
Post by Martin Honnen
Post by malhenry
How does one migrate C++ code from MSXML 1.0 to version 4.0 ? I have
installed version 4.0, but I suspect my code is using version 1.0 or some
version prior to 4.0.
// Microsoft DOM Control Support
#import "msxml.dll" named_guids raw_interfaces_only
The online MSXML SDK has some sections that should help, see
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/0f704b2c-a42f-4fca-aee3-bf66393e2db4.asp>
first for the different program ids and files that belong to the
different versions.
Then check
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/6976372b-9f4d-4d6f-91df-a6936b52c127.asp>
on how to use MSXML with C/C++.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Loading...