Hi,
 
Thanks for looking at this post. I've recently downloaded Xerces2.3 C++ and have managed to compile and build the Bcc.551 code (using the patch provided for bug 20353). However, I cannot get the sample programs to successfully run. Whenever a new SAX or DOM parser is created I get an access violation in the constructors of either XMLBufferMgr.cpp or XMLBuffer.hpp (see code at bottom of post). The exceptions thrown include "Read of Address: xxx", where xxx is the adress of the MemoryManager passed in to the constructor.
 
Has anybody else experienced these problems or got any ideas about what I might be doing wrong? Any help would be gratefully received.
 
Thanks,
Rebecca Vernon
Research Scientist - QinetiQ
 
 
************************************************************************
XMLBufferMgr::XMLBufferMgr(MemoryManager* const manager) :
    fBufCount(32)
    , fMemoryManager(manager)
    , fBufList(0)
{
    // Allocate the buffer list and zero it out
    // *** VIOLATION THROWN ON LINE BELOW ***
    fBufList = (XMLBuffer**) fMemoryManager->allocate(fBufCount * sizeof(XMLBuffer*)); // new XMLBuffer*[fBufCount];
    for (unsigned int index = 0; index < fBufCount; index++)
        fBufList[index] = 0;
}
 
************************************************************************
XMLBuffer(int capacity = 1023
              , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) :
 
        fUsed(false)
        , fIndex(0)
        , fCapacity(capacity)
        , fMemoryManager(manager)
        , fBuffer(0)
    {
        // Buffer is one larger than capacity, to allow for zero term
       // *** VIOLATION THROWN ON LINE BELOW ***
        fBuffer = (XMLCh*) manager->allocate((capacity+1) * sizeof(XMLCh)); // new XMLCh[fCapacity+1];
 
        // Keep it null terminated
        fBuffer[0] = XMLCh(0);
    }
*********************************************************************************

Reply via email to