VC++ 6 to VC++ 2008 migration error IXMLDOMNode' : ambiguous symbol

I am migrating my VC++ 6 project to Visual Studio 2008.

Vc++ 2008 giving the following error during compilation.
The header file has the following declaration

#import "msxml6.dll"      
using namespace MSXML2;

c:\Test\source\MyApp\../ptmMigration/ptmPolicy.h(321) : error C2872: 'tagDOMNodeType' : ambiguous symbol
        could be 'c:\program files\microsoft sdks\windows\v6.0a\include\msxml.h(350) : tagDOMNodeType'
        or       'c:\Test\source\MyApp\../ptmMigration\debug\msxml6.tlh(352) : MSXML2::tagDOMNodeType'
c:\Test\source\MyApp\../ptmMigration\../ptmMigration/ptmPolicy.h(321) : error C2872: 'IXMLDOMNode' : ambiguous symbol
        could be 'c:\program files\microsoft sdks\windows\v6.0a\include\msxml.h(531) : IXMLDOMNode'

Thanks in advance.
bobbeyAsked:
Who is Participating?
 
pgnatyukConnect With a Mentor Commented:
Here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;316317

You will find this code:

#import "c:\winnt\system32\msxml4.dll"
using namespace MSXML2;

int main(int argc, char* argv[])
{
      IXMLDOMDocumentPtr dom(__uuidof(DOMDocument40));

change for 6 and try.

Here is a solution from Microsoft:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;269194
0
 
pgnatyukCommented:
Can you check that:

#import  raw_interfaces_only
using namespace MSXML2;

The following link may help:
http://msdn.microsoft.com/en-us/library/ms765540(VS.85).aspx

0
 
bobbeyAuthor Commented:
Included
#import <msxml6.dll> raw_interfaces_only
using namespace MSXML2;
But that didnt work, same set of errors again.
0
 
pgnatyukCommented:
So remove namespace MSXML2 and use MSXML2::IXMLDOMNode explicitly
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.