Thanks. You're right, XMLPlatformUtils::fgTransService is 0 before it's
initialized.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 12:05 PM
To: [EMAIL PROTECTED]
Subject: Re: How can I tell if Xerces has been initialized?






> I have a utility function that calls Xerces to do string transcoding.
This
> requires XMLPlatformUtils::Initialize() to be called. However, I can't
> guarantee that a random client calling me has called this before. At the
> same time, I can't just call it because the caller might be in the middle
of
> a parse.

Yes, you can.  There's a counting scheme that keeps the library from being
initialized more than once.  However, the initialization counting scheme is
not thread-safe, so you had better make sure multiple threads don't try to
initialize Xerces-C at the same time.

>
> How can I check if Xerces has been initialized already? I thought of
> checking the value of the pointer that I need
> (XMLPlatformUtils::fgTransService), but of course I won't be able to
tell.
> It will have a garbage value that looks just like a valid pointer.

No, I don't think it will -- it will either be a valid pointer, or 0.  Some
investigation on your part could confirm this.

Dave


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

-------------------------------------------------------------------------------
This message and any included attachments are from Siemens Medical Solutions 
USA, Inc. and are intended only for the addressee(s).  
The information contained herein may include trade secrets or privileged or 
otherwise confidential information.  Unauthorized review, forwarding, printing, 
copying, distributing, or using such information is strictly prohibited and may 
be unlawful.  If you received this message in error, or have reason to believe 
you are not authorized to receive it, please promptly delete this message and 
notify the sender by e-mail with a copy to [EMAIL PROTECTED]  Thank you

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

Reply via email to