Enviroment: VC 6.0-SP5 / XML SDK 3.0
Error: XmlParserDlg.cpp(342) : error C2660: 'nextNode' : function does not take 1 parameters
Can You help me ?
Thanks a lot.
Best regards.
A quick download of the code and a recompile works fine on my machine. Further, the corresponding entry for "nextNode" on an IXMLDOMNode does indeed only take a single parameter.
Could you check the following:
1) You have the XML 3.0 header files of msxml.h or msxml2.h included higher in your search order than the "default" include files.
2) If so, search the msxml.h or msxml2.h file for an entry where "nextNode" takes a pointer to an IXMLDOMNode*. My copy of msxml2.h has this on line 6880, where you can see that it takes a single parameter.
It took me a while (downloading the SDK etc) but I learnt a lot doing it. As I'm learning XML it's just the kick start I need. Now to add some frills..
For Visual Basic developement, using the Microsoft XML Parser is fine, since it is a COM component, and an XML parser written strictly in VB would probably be quit slow. However, if you plan to distribute your XML enabled C++ application to people other than those whom you work with, I would suggest using the Xerces (XML4C) XML Parser. First, you only have to distribute one or two DLL's (depending on which file drop you've downloaded), with your application to support the library. Second, and most importantly in my opinion, is there are NO requirements that the end user have any specific version of IE installed (or installed at all, for that matter). XML4C is a set of C++ classes, therefore there is no need to instantiate COM, or worry about QueryInterface and it's sister functions. It's also extremely fast, in my experience. If nothing else, do your self a favor and at least give it a look. You can find the Xerces (XML4C) library at http://xml.apache.org/dist/xerces-c/stable/xerces-c1_3_0-win32.zip
That, unfortunately, requires a seperate download. You need to download the Xalan library (available at http://xml.apache.org/xalan-c/getstarted.html#download). I haven't really had time to play with it much yet, but it unfortunately looks somewhat cryptic. If I can ever figure it out, I'll post an example here.
I recently tried XML4C / Xerces and spent a lot of time and effort with it. In the end I gave up and went to LibXml ( http://xmlsoft.org ) which seems a lot nicer so far, at least depending on which features of XML you need.
Major problems I had with XML4C / Xerces were:
* Almost complete lack of documentation. It's fine to say "read the XML and DOM specs" but a lot of their classes are nothing to do with the XML and DOM specs. What little documentation there is is usually just some comments from the header files, if you're lucky -- usually nothing. (It's free so they don't have to make my life easy and I'm not complaining, just saying that I found it unusable in places.)
* No "save" method which means you have to write your own code to save XML to files. (There are some classes to help you do this but they are not documented. I got them to work after a lot of web searching and hacking through the source code, and I have to say I really didn't like the way things worked, but that's a matter of style / preference. Either way, you're looking at a lot of effort if you want to save XML to files.)
* The nail in the coffin was when I found that I was getting random errors which I think traced back to the fact that the Xerces DLL was calling "new" and expecting me to call "delete". This isn't safe if you're linking to a different version of the C Runtime to the DLL (which I was). Although I could've fixed the problem by recompiling the DLL (creating a version incompatible with other programs), this mistake (rather than providing a Delete/Free function stub in the DLL) seemed yet another sign of bad design and I figured that I'd wasted enough of my life fighting this thing already.
Xerces does seem to be a big, serious XML implementation so I'm sure it's great for some people. Personally, I'm very happy with LibXml ( http://xmlsoft.org ).
For every single thing some smart ppl wants me to use tons of undocumented classes. Life is too short for this. Not a great option. This XML stuff is a tiny little thing compare with an app has to do and should be done EASILY
Due to only just finding out how many versions of the XML parser there are out there (see http://msdn.microsoft.com/xml/general/replacemode.asp for details of this), I've downloaded and integrated the latest SDK and parser made available by Microsoft -- http://msdn.microsoft.com/xml/general/msxmlprev.asp
After adding "C:\Program Files\Microsoft Xml Parser Sdk\Inc" to my project source directories and "C:\Program Files\Microsoft Xml Parser Sdk\Lib" to the corresponding library section, the only change necessary to make the code compile/link/run on my system was to change the header file of XmlParserDlg.h from:
#include "msxml.h"
to
#include "msxml2.h"
For completness, my system configuration is:
Windows NT4.0 (Sp6) / Windows 2000 (Sp1)
Visual C++ ver 6 (Sp4)
Platform SDK (July 2000)
Internet Explorer 5.5
*new today* Microsoft XML Parser 3/SDK (September 2000).
I get some more compiler errors as follows even after including msxml2.h in the stdafx.h.
--------------------Configuration: xmlparser - Win32 Debug--------------------
Compiling...
XmlParserDlg.cpp
e:\xml\xmlparser\xmlparserdlg.cpp(96) : error C2065: 'CLSID_DOMDocument2' : undeclared identifier
e:\xml\xmlparser\xmlparserdlg.cpp(96) : error C2065: 'IID_IXMLDOMDocument' : undeclared identifier
e:\xml\xmlparser\xmlparserdlg.cpp(101) : error C2027: use of undefined type 'IXMLDOMDocument'
c:\program files\microsoft xml parser sdk\inc\msxml2.h(56) : see declaration of 'IXMLDOMDocument'
e:\xml\xmlparser\xmlparserdlg.cpp(101) : error C2227: left of '->put_async' must point to class/struct/union
e:\xml\xmlparser\xmlparserdlg.cpp(105) : error C2027: use of undefined type 'IXMLDOMDocument'
c:\program files\microsoft xml parser sdk\inc\msxml2.h(56) : see declaration of 'IXMLDOMDocument'
e:\xml\xmlparser\xmlparserdlg.cpp(105) : error C2227: left of '->load' must point to class/struct/union
e:\xml\xmlparser\xmlparserdlg.cpp(110) : error C2027: use of undefined type 'IXMLDOMDocument'