Converting very old VC++ to VS2005 and MSXML
-
Folks, I have a project I'm trying to convert from VC++ MFC to VS2005, and I'm having a problem with msxml (and I know NOTHING about MFC -- have never coded in it). Basically, there is an msxml.cpp/.h in the project directory, and when I compile, I am getting type redefintion errors.
MSXML.cpp
e:\....\graphing\mpactgrafx activex control\msxml.h(972) :
error C2011: 'XMLDOMDocumentEvents' : 'struct' type redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\msxml.h(9495) : see declaration of 'XMLDOMDocumentEvents'in the PROJECT msxml.h:
class XMLDOMDocumentEvents : public COleDispatchDriver
and in the platformsdk\Include\msxml.h:
XMLDOMDocumentEvents : public IDispatch
Looks like it is pulling in not only the local msxml (which is what I want it to use), but also the c:\program files\Microsoft Visual Studio 8\VC\PlatformSDK\include\msXml.h so I am getting the redef in the project msxml stuff. I don't see any real way to EXCLUDE only that platformSDK\Include\msxml.h file during compilation. I've tried the tools->options->project..-> VC++ directories, but if I exclude that platformSDK\include, I get all sorts of badness happening. If I get rid of the local msxml.h/cpp, I also get bad things happening (due to used objects from that old msxml missing) Any help greatly appreciated.
-
Folks, I have a project I'm trying to convert from VC++ MFC to VS2005, and I'm having a problem with msxml (and I know NOTHING about MFC -- have never coded in it). Basically, there is an msxml.cpp/.h in the project directory, and when I compile, I am getting type redefintion errors.
MSXML.cpp
e:\....\graphing\mpactgrafx activex control\msxml.h(972) :
error C2011: 'XMLDOMDocumentEvents' : 'struct' type redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\msxml.h(9495) : see declaration of 'XMLDOMDocumentEvents'in the PROJECT msxml.h:
class XMLDOMDocumentEvents : public COleDispatchDriver
and in the platformsdk\Include\msxml.h:
XMLDOMDocumentEvents : public IDispatch
Looks like it is pulling in not only the local msxml (which is what I want it to use), but also the c:\program files\Microsoft Visual Studio 8\VC\PlatformSDK\include\msXml.h so I am getting the redef in the project msxml stuff. I don't see any real way to EXCLUDE only that platformSDK\Include\msxml.h file during compilation. I've tried the tools->options->project..-> VC++ directories, but if I exclude that platformSDK\include, I get all sorts of badness happening. If I get rid of the local msxml.h/cpp, I also get bad things happening (due to used objects from that old msxml missing) Any help greatly appreciated.
Add your local directory to the C++->General->Additional Include Directories property (Debug AND Release). That should mean the compiler sees your local msxml.h before (and instead of) the Platform SDK one. Or, change the msxml #includes to
#include "./msxml.h"
I think that might work as well?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Add your local directory to the C++->General->Additional Include Directories property (Debug AND Release). That should mean the compiler sees your local msxml.h before (and instead of) the Platform SDK one. Or, change the msxml #includes to
#include "./msxml.h"
I think that might work as well?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
Thanks -- actually DID include the local dir to resolve a few other issues -- this one is the only one I have left outstanding at the moment (at least until THIS one clears and the compilation finds something else :wtf: ) I have tried the "./msxml.h" also, but I am still getting that error message (I even put in the entire path, same result).
-
Thanks -- actually DID include the local dir to resolve a few other issues -- this one is the only one I have left outstanding at the moment (at least until THIS one clears and the compilation finds something else :wtf: ) I have tried the "./msxml.h" also, but I am still getting that error message (I even put in the entire path, same result).
gartnerj wrote:
I have tried the "./msxml.h" also, but I am still getting that error message (I even put in the entire path, same result).
Well, that's spooky. Have you changed ALL #includes of msxml.h? Try checking stdafx.h and rebuilding from scratch.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
gartnerj wrote:
I have tried the "./msxml.h" also, but I am still getting that error message (I even put in the entire path, same result).
Well, that's spooky. Have you changed ALL #includes of msxml.h? Try checking stdafx.h and rebuilding from scratch.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Yeah, really strange. There are only two references to #include "msxml.h" in the project: 1)a generated MSXML.cpp file 2)a DataParse.h (which is where a bunch of custom parsing code is defined). No other #include of msxml.h at all!!:confused:
Add or make sure the following is in your stdafx.h
#ifndef VC_EXTRALEAN #define VC_EXTRALEAN #endif
How to use VC_EXTRALEAN and WIN32_LEAN_AND_MEAN to enhance the build process in Visual C++[^] Let me know if this works. Best Wishes, -David Delaune -
Add or make sure the following is in your stdafx.h
#ifndef VC_EXTRALEAN #define VC_EXTRALEAN #endif
How to use VC_EXTRALEAN and WIN32_LEAN_AND_MEAN to enhance the build process in Visual C++[^] Let me know if this works. Best Wishes, -David DelauneThanks David, I had seen the WIN_LEAN_AND_MEAN setting and had tried that with no luck. I tried the VC_EXTRALEAN, and I still get the errors:
DataParse.cpp
e:\....\graphing\mpactgrafx activex control\msxml.h(977) :
error C2011: 'XMLDOMDocumentEvents' :
'struct' type redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\msxml.h(9495) :
see declaration of 'XMLDOMDocumentEvents'
MSXML.cpp
e:\....\graphing\mpactgrafx activex control\msxml.h(977) :
error C2011: 'XMLDOMDocumentEvents' :
'struct' type redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\msxml.h(9495) : see declaration of 'XMLDOMDocumentEvents'No joy yet.
-
Thanks David, I had seen the WIN_LEAN_AND_MEAN setting and had tried that with no luck. I tried the VC_EXTRALEAN, and I still get the errors:
DataParse.cpp
e:\....\graphing\mpactgrafx activex control\msxml.h(977) :
error C2011: 'XMLDOMDocumentEvents' :
'struct' type redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\msxml.h(9495) :
see declaration of 'XMLDOMDocumentEvents'
MSXML.cpp
e:\....\graphing\mpactgrafx activex control\msxml.h(977) :
error C2011: 'XMLDOMDocumentEvents' :
'struct' type redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\msxml.h(9495) : see declaration of 'XMLDOMDocumentEvents'No joy yet.
-
Thanks David, I had seen the WIN_LEAN_AND_MEAN setting and had tried that with no luck. I tried the VC_EXTRALEAN, and I still get the errors:
DataParse.cpp
e:\....\graphing\mpactgrafx activex control\msxml.h(977) :
error C2011: 'XMLDOMDocumentEvents' :
'struct' type redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\msxml.h(9495) :
see declaration of 'XMLDOMDocumentEvents'
MSXML.cpp
e:\....\graphing\mpactgrafx activex control\msxml.h(977) :
error C2011: 'XMLDOMDocumentEvents' :
'struct' type redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\msxml.h(9495) : see declaration of 'XMLDOMDocumentEvents'No joy yet.
-
:(( Ok, lets be patient and work through this. First thing you need to do is find out where msxml.h is being included. Do you have
#include <urlmon.h>
included anywhere? Best Wishes, -David DelauneWindows.h #includes Ole2.h which #includes ObjBase.h which #includes urlmon.h No way round getting the SDKs msxml.h, as far as I can tell.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Thanks David, I had seen the WIN_LEAN_AND_MEAN setting and had tried that with no luck. I tried the VC_EXTRALEAN, and I still get the errors:
DataParse.cpp
e:\....\graphing\mpactgrafx activex control\msxml.h(977) :
error C2011: 'XMLDOMDocumentEvents' :
'struct' type redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\msxml.h(9495) :
see declaration of 'XMLDOMDocumentEvents'
MSXML.cpp
e:\....\graphing\mpactgrafx activex control\msxml.h(977) :
error C2011: 'XMLDOMDocumentEvents' :
'struct' type redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\msxml.h(9495) : see declaration of 'XMLDOMDocumentEvents'No joy yet.
A suggestion. Stuff your local msxml.h inside a namespace when #including it:
namespace Old
{
#include "msxml.h"
}and then explicitly specify the namespace when using the structures out of your local file - e.g.
Old::XMLDOMDocumentEvents events;
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
:(( Ok, lets be patient and work through this. First thing you need to do is find out where msxml.h is being included. Do you have
#include <urlmon.h>
included anywhere? Best Wishes, -David Delaune -
A suggestion. Stuff your local msxml.h inside a namespace when #including it:
namespace Old
{
#include "msxml.h"
}and then explicitly specify the namespace when using the structures out of your local file - e.g.
Old::XMLDOMDocumentEvents events;
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
A suggestion. Stuff your local msxml.h inside a namespace when #including it:
namespace Old
{
#include "msxml.h"
}and then explicitly specify the namespace when using the structures out of your local file - e.g.
Old::XMLDOMDocumentEvents events;
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p