stefanw wrote:
Hi,
In my application I want to throw a parsing error like so,
SAXParseException((const XMLCh *const) "Error...", position,
XMLPlatformUtils::fgMemoryManager));
Why do you think casting from const char* to const XMLCh* will work? You
need to transcode the string from the local code page to UTF-16 first. You
can use one of the XMLString::transcode() functions to do that.
but I get the following typing error (in Visual Studio 2005),
"error C2665: 'xercesc_2_7::SAXParseException::SAXParseException' : none of
the 3 overloads could convert all the argument types
could be 'xercesc_2_7::SAXParseException::SAXParseException(const XMLCh
*const ,const xercesc_2_7::Locator &,xercesc_2_7::MemoryManager *const )'
while trying to match the argument list '(const XMLCh *,
xercesc_2_7::Locator *, xercesc_2_7::MemoryManager *)'"
The constructor you're trying to call takes a reference to a Locator, not a
pointer to one. Note that there is no need to provide the global
MemoryManager instance, since that's the default argument for the constructor.
Dave