• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2795
  • Last Modified:

How to determine if the machine has Microsoft Core XML Services (MSXML) 6.0 installed?

How to use C/C++ to determine if the current machine with Microsoft Core XML Services (MSXML) 6.0 installed or not.
0
sunsa
Asked:
sunsa
  • 2
  • 2
1 Solution
 
jkrCommented:
See http://support.microsoft.com/kb/278674 ("Determine the Version of MSXML Parser Installed on a Computer")
0
 
FelixDaCaTCommented:
sunsa,

I believe you are looking for a programmatic way to discover if the machine your program is running on supports msxml 6.0.

http://www.perfectxml.com/CPPMSXML/20020710.asp lists the GUIDs and ProgIDs for the various MSXML 6.0 components.

Since Microsoft removed version-independent GUIDs and ProgIDs  in MSXML 4.0 and above you can just do a simple registry key lookup for a MSXML 6.0 component GUID.

For example:
{88d96a05-f192-11d4-a65f-0040963251e5} is the GUID for the DOMDocument version 6.0

I could use that knowledge to query the key in the registry. If it exists then machine supports MSXML 6.0.
----
HKEY hkey;
retVal = RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("CLSID\\{88d96a05-f192-11d4-a65f-0040963251e5})",0,KEY_QUERY_VALUE,&hkey);
if (retVal != ERROR_SUCCESS) return false.
-----

Should be noted that you should code some error checking and possibly contain the code within a try catch block

Good Luck
Felix

0
 
FelixDaCaTCommented:
Let me clarify my answer. I posted the wrong link.
http://msdn2.microsoft.com/en-us/library/ms764622.aspx is the link guids and progids.
http://www.perfectxml.com/CPPMSXML/20020710.asp  is a link to example code on how to discover if msxml 4.0 is installed.

Good Luck
Felix
0
 
sunsaAuthor Commented:
Thanks for your feedback, I will take a try and get back to you.
0
 
jkrCommented:
Thank you! ;o)
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now