You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by "<Cyberbob>" <ma...@gmx.de> on 2008/11/25 12:36:24 UTC

MSXML.H - Redefinition of DOMDocument Basetype VS 2008

Hi!

I'm getting crazy with this compilation error in VS 2008:

C3271: DOMDocument redefinition ... file: msxml.h

I already tried the WIN32_LEAN_AND_MEAN definition - doesn't work!

I removed windows.h and i only include STL - classes....

what can i do to find out where msxml.h gets included???

thanks a lot!!

greetings
-- 
View this message in context: http://www.nabble.com/MSXML.H---Redefinition-of-DOMDocument-Basetype-VS-2008-tp20679561p20679561.html
Sent from the Xerces - C - Users mailing list archive at Nabble.com.


RE: MSXML.H - Redefinition of DOMDocument Basetype VS 2008

Posted by Th...@emc.com.
Another approach is to specify the namespace for the DOMDocument, which
fixed my issues when dealing with this same issue.

For example:

Void foo(XERCES_CPP_NAMESPACE::DOMDocument* pDocument);

The specific namespace classification allows the compiler and linker to
successfully resolve without conflicts.

Regards,
Nicholas
 

-----Original Message-----
From: Alberto Massari [mailto:amassari@datadirect.com] 
Sent: Tuesday, November 25, 2008 4:45 AM
To: c-users@xerces.apache.org
Subject: Re: MSXML.H - Redefinition of DOMDocument Basetype VS 2008

msxml.h is included deep in ole2.h; the only way to fix this is to add a

#undef DOMDocument before including the Xerces headers.

Alberto

<Cyberbob> wrote:
> Hi!
>
> I'm getting crazy with this compilation error in VS 2008:
>
> C3271: DOMDocument redefinition ... file: msxml.h
>
> I already tried the WIN32_LEAN_AND_MEAN definition - doesn't work!
>
> I removed windows.h and i only include STL - classes....
>
> what can i do to find out where msxml.h gets included???
>
> thanks a lot!!
>
> greetings
>   



Re: MSXML.H - Redefinition of DOMDocument Basetype VS 2008

Posted by "<Cyberbob>" <ma...@gmx.de>.
Wow, that was a quick reply!

Thanks Mister, now it works! It helped me finding the error, the reason is a
different though: I got this file XStr.h with the following code (which
actually converts a char to an XMLString):

#ifndef _XSTR_
#define _XSTR_
#include "xercesc/util/XMLString.hpp"

//XERCES_CPP_NAMESPACE_USE
using namespace xercesc_3_0;
// ------------------------------------------------------------------------
//
//  Klasse XStr																//
//  Hilfsklasse für Benutzung von XMLString. Stellt sicher, dass die		//
//  Resourcen von XMLString wieder automatisch freigegeben werden, wenn		//
//  sie nicht mehr genutzt werden.											//
// ------------------------------------------------------------------------
//
class XStr
{
public :
	XStr(const char* const toTranscode) 
	{ fUnicodeForm = XMLString::transcode(toTranscode); }
	~XStr() { XMLString::release(&fUnicodeForm); }
	const XMLCh* unicodeForm() const { return fUnicodeForm; }
private :
	XMLCh*   fUnicodeForm;
};

#define X(str) XStr(str).unicodeForm()
#endif

if i include this file in ANY header file of my project, i get this error-
Including it in cpp files works fine... happily i don't have to include it
in headers - but why doesn't it work?

Now i can have lunch in peace at least;-)

thanks a lot!
-- 
View this message in context: http://www.nabble.com/MSXML.H---Redefinition-of-DOMDocument-Basetype-VS-2008-tp20679561p20680143.html
Sent from the Xerces - C - Users mailing list archive at Nabble.com.


Re: MSXML.H - Redefinition of DOMDocument Basetype VS 2008

Posted by Alberto Massari <am...@datadirect.com>.
msxml.h is included deep in ole2.h; the only way to fix this is to add a 
#undef DOMDocument before including the Xerces headers.

Alberto

<Cyberbob> wrote:
> Hi!
>
> I'm getting crazy with this compilation error in VS 2008:
>
> C3271: DOMDocument redefinition ... file: msxml.h
>
> I already tried the WIN32_LEAN_AND_MEAN definition - doesn't work!
>
> I removed windows.h and i only include STL - classes....
>
> what can i do to find out where msxml.h gets included???
>
> thanks a lot!!
>
> greetings
>