Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Following code runs properly on 32 bit (with msxml6.dll for 32 bit) but add function fails on 64 bit os (with msxml6.dll for 64 bit)

What might be the reason?
C++
<msxml2::isaxxmlreaderptr mode="hold" xmlns:msxml2="#unknown" />        MSXML2::IXMLDOMSchemaCollection2Ptr pSchemaColl;
        SAXErrorHandlerImpl* pErrorHandler = NULL;
        TESTHR( pSAXReader.CreateInstance(__uuidof(MSXML2::SAXXMLReader60) ));

        pErrorHandler = SAXErrorHandlerImpl::CreateInstance();
        TESTHR( pSAXReader-&gt;putErrorHandler(pErrorHandler));

        TESTHR(pSAXReader-&gt;putContentHandler(this));

        TESTHR( pSchemaColl.CreateInstance(__uuidof(MSXML2::XMLSchemaCache60)));

        std::tstring tstrXSDPath = xsdFileWithPath;

        TESTHR(  pSchemaColl-&gt;add(_bstr_t(&quot;http://www.ebxml.org/namespaces/messageHeader&quot;),
                                  _variant_t( tstrXSDPath.c_str())));
Posted
Updated 24-Mar-11 23:54pm
v2

Chances are, you're trying to mix 32-bit and 64-bit executable files (I mean, PE files, DLLs or EXEs or anything). They are incompatible but can be linked during build crashing only during run-time. You need to investigate all your dependencies. Microsoft Dependency Walker can help you, see http://www.dependencywalker.com/[^].

—SA
 
Share this answer
 
on 32 bit I was using msxml4.dll for 64 bit msxml6.dll.

the given xsd failing to add in XMLDOMSchemaCache as In Msxml6 the when any xsd is loaded into cache is creates
the dOMDocument with deafut properties( ProhibitDTD true) and given XSD is importing the older version XML.xsd from "http://www.w3.org/2001/03/xml.xsd which refers XmlSchemadtd.

Hence to resolve this error modified XML.xsd to use http://www.w3.org/2007/08/xml.xsd
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900