THANK YOU!!!!

I moved the Initialise and Terminate into the main class constructor and
destructor and it happily processes multiple XML files in a seperate thread.

Sid



-----Original Message-----
From: Joachim Achtzehnter [mailto:[EMAIL PROTECTED]]
Sent: Friday, 21 December 2001 9:33 AM
To: [EMAIL PROTECTED]
Subject: Re: Xerces and multithreading on Win2K


[EMAIL PROTECTED] you wrote:
>
> I have re-engineered a VC++(6) application to a multithreaded design and
now
> find that calls to xerces functions (v1.5) crash.
>
> The thread sits and monitors a directory for XML file and then creates an
> object (CStateMachine) to process the file (the file is represented as a
> CDataFile object in the code below).
>
> The first XML file collected and processed seams to work, then the
> (CStateMachine) object is destoryed, but when the second attempt is made
to
> create the object, the application crashs when it goes to creae a new
> SAXParser object.
>
> bool CStateMachine::CommandProcess(CDataFile *pDF)
> {
>    ...
>         XMLPlatformUtils::Initialize();
>    ...
>       XMLPlatformUtils::Terminate();
>    ...
> }

In Xerces 1.5 the Terminate() function (maybe also Initialize?) must be
called at most once per process. After a process has called Terminate()
you can no longer use Xerces in this process.

Joachim

-- 
work:     [EMAIL PROTECTED]   (http://www.netacquire.com)
private:  [EMAIL PROTECTED]          (http://www.kraut.ca)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to