none
MSXML2 error on Windows 8 with Visual Studio 2010 RRS feed

  • Question

  • Hi,

    On compiling my project in Visual Studio 2010 on Windows 8, it gives the following MSXML errors:

    error C2065: 'DOMDocument60' : undeclared identifier     ..\somepath\myfile1.cpp

    error C2039: 'DOMDocument60' : is not a member of 'MSXML2'     ..\somepath\myfile2.cpp

    This is legacy code, so I'm not sure if something else is needed to be done, especially on Windows 8. The same code compiles on Windows 7. Appreciate any help.

    TIA,

    Jy

    • Moved by Damon Zheng Wednesday, February 20, 2013 8:11 AM
    Thursday, February 7, 2013 1:51 PM

All replies

  • Are you using the #import statement? If so, which MSXML file are you importing? When you click on file properties, what is the file version?
    Thursday, February 7, 2013 4:23 PM
  • Sorry about getting back late on this.

    Yes, I'm using #import. The original code imports msxml3.dll, the file version is: 8.110.9200.16384

    On using this, I get errors like:

    error C2039: 'DOMDocument60' : is not a member of 'MSXML2'
    error C2065: 'DOMDocument60' : undeclared identifier

    But, when I installed MSMXL 6 (using MSXML6.msi), and changed the #import statements to use msxml6.dll, I get many errors like these:

    msxml6.tlh(2815): error C2011: 'MSXML2::IXMLDOMComment' : 'struct' type redefinition

    On cleaning and rebuilding, the Release folder has both msxml6.tlh and msxml3.tlh which seems to be causing the above error, even though msxml3.dll is not imported.

    How do I fix these?

    Thanks,
    Jy

    Thursday, February 14, 2013 12:06 PM
  • Use as import MSXML6.DLL. I suspect MSXML3.DLL does not exits on Windows 8. It is also not present on all Windows 7 systems, at least on x64 systems it is missing (if I remember correctly).


    Best regards

    Bordon

    Note: Posted code pieces may not have a good programming style and may not perfect. It is also possible that they do not work in all situations. Code pieces are only indended to explain something particualar.




    • Edited by Bordon Thursday, February 14, 2013 12:58 PM
    Thursday, February 14, 2013 12:51 PM
  • Like I mentioned, I had changed the #import statements to use msxml6.dll. I still get the errors mentioned.

    Also, from here:

    en.wikipedia.org/wiki/MSXML
    Version 6, 4, and 3 may all be installed and running concurrently. Doesn't look like it is something to do with Windows 8, but I'm not sure.

    Regards,

    Jy

    Thursday, February 14, 2013 1:20 PM
  • Like I mentioned, I had changed the #import statements to use msxml6.dll. I still get the errors mentioned.


    Multiple #import statements? Note you can only import one version of msxml, so pick one. msxml3.dll doesn't define DOMDocument60 so that error message makes sense.

    Note also that you cannot use both #include "msxml2.h" as well as the #import statement. Just stick with a single #import statement.

    It's time to show all your #import statements, and if there are errors, show not just the error message but the source code which corresponds to the error message.

    Thursday, February 14, 2013 3:31 PM
  • I also guess it is time to show some parts of code and the imports.

    I checked Win8 a few minutes ago. Win8 has: MSXML3.dll and MSXML6.dll, MSXML4.DLL is missing. I was wrong and was mixed up with V3 and V4.


    Best regards

    Bordon

    Note: Posted code pieces may not have a good programming style and may not perfect. It is also possible that they do not work in all situations. Code pieces are only indended to explain something particualar.

    Thursday, February 14, 2013 4:01 PM
  • No, I just have a single #import statement....that was just a typo.

    I have commented out msxml3.dll, and imported only msxml6.dll, as shown below:

    //#import <msxml3.dll>
    #import <msxml6.dll>

    I clearly *don't* have any #include statements like you've mentioned, just the #import.

    But I get errors like these:

    msxml3.tlh(333): error C2011: 'MSXML2::IXMLDOMImplementation' : 'struct' type redefinition

    msxml3.tlh(354): error C2011: 'MSXML2::tagDOMNodeType' : 'enum' type redefinition

    msxml3.tlh(371): error C2011: 'MSXML2::IXMLDOMParseError' : 'struct' type redefinition

    Like I'm saying, I'm not sure how msxml3.h is getting generated in the output directory.

    Also, note that I am not allowed to post any of the real code, since it is IP protected.

    Regards,
    Jy

    Friday, February 15, 2013 12:16 PM
  • Delete your msxml3.tlh and msxml3.tli file. Recompile again. If the msxml3.tlh file is recreated, then somewhere in your source code you have an #import <msxml3.dll> hiding, contrary to your belief.
    Friday, February 15, 2013 3:31 PM
  • Yes, msxml3.tlh and msxml3.tli are getting generated. Of course, I've searched my solution files for msxml3 and removed all references. But since these files are still getting generated, I presume some header that I've included (or which has been included by those headers in turn) must be including msxml3. I have multiple such headers from external projects, and it would be very time consuming to search them manually.

    Is it possible to search this in a cascading manner to see if any of those headers have it? I remember having done such an inclusive search in some previous version of Visual Studio, but can't recall how.

    Thanks again,

    Jy

    Monday, February 18, 2013 8:04 AM
  • Hello,

    We have a specific forum for MSXML issues: http://social.msdn.microsoft.com/Forums/is/xmlandnetfx/threads

    This thread will be moved to that forum. Thanks for your understanding.

    Regards,


    Damon Zheng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, February 20, 2013 8:11 AM
  • Did you ever find the resolution to this problem?  I'm experience the exact same thing.

    Thanks - Justin

    Wednesday, February 5, 2014 8:48 PM
  • Hi,

    I also facing this Problem under windows 10. Did anyone found a solution? For me it seams windows 10’s msxml3.dll only knows DOMDocument, DOMDocument28 and DOMDocument30

    My Windows 7 where everything works has version 8.100.5002.0 and description MS XML 3.0 SP10. While Windows 10 brings 8.110.10586.589” and description MS XML 3.0.

    Thanks,
    Daniel

    Tuesday, December 27, 2016 12:58 PM