Setting the lexical handler for an MSXML parser

Started by
0 comments, last by rsegal 19 years, 6 months ago
So I've got a block of code like so

if ( SUCCEEDED(m_pParser.CreateInstance(__uuidof(SAXXMLReader40))) ) 
    {
      m_pSAXLexicalHandler = new SAXLexicalHandlerMSXML();
      HRESULT hr = m_pParser->putProperty(L"http://xml.org/sax/properties/lexical-handler", (_variant_t)m_pSAXLexicalHandler);
}

The call to CreateInstance works however the call to putProperty returns E_FAIL which from what I can tell in MSDN means that the parser is in the process of parsing. But I just created it and I haven't told it to process anything yet. Things just aren't making any sense? Anyone have any thoughts.
Rob Segal - Software Developerrob@sarcasticcoder.com
Advertisement
Success, I found the solution to my problem searching through google groups. You need to implement QueryInterface for your custom lexical handler that you override from ISAXLexicalHandler.
Rob Segal - Software Developerrob@sarcasticcoder.com

This topic is closed to new replies.

Advertisement