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.
sunsaAsked:
Who is Participating?
 
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
 
jkrCommented:
See http://support.microsoft.com/kb/278674 ("Determine the Version of MSXML Parser Installed on a Computer")
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.