You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Clint Phillips <cp...@apriva.com> on 2001/02/25 18:35:48 UTC
PlatformUtils::Initialize()
Hi all,
If I'm understanding correctly PlatformUtils::Initialize() can only be
called once per process, and doing so more than once will cause issues. I'm
using Xercies in a multithreaded dll and this is a little bit of a pain. I'm
planning on using a flag with one of the interlocked functions(Win32) if
this is truely the case. PlatformUtils is required, right?(I couldn't get
things working w/o it.)
Thanks, Clint
Re: PlatformUtils::Initialize()
Posted by Joe Polastre <jp...@apache.org>.
It is reference counted now, this is something I did quite a few months ago
for people that wanted to call init/term multiple times. As far as I know,
term() still doesn't really do very much at all. The ref count is
definitely a very weak reference count though. Like simon said, the best
bet is to do it once in dllmain.
-Joe
www.polastre.com
At 09:44 AM 2/25/2001 -0800, you wrote:
>i believe that internally now Init / Term is ref counted. However if
>you're doing a win32 dll, by far the easiest approach is to just call
>Init / Term once in dllmain.
>
>Cheers
>Simon
RE: PlatformUtils::Initialize()
Posted by Clint Phillips <cp...@apriva.com>.
Come to think of it, PlatformUtils::Initialize doesn't call LoadLibrary,
right? That is where WSAStartup problems stem from(calling LoadLibrary in
DllMain).
-Clint
-----Original Message-----
From: Clint Phillips [mailto:cphillips@apriva.com]
Sent: Sunday, February 25, 2001 10:56 AM
To: xerces-c-dev@xml.apache.org
Subject: RE: PlatformUtils::Initialize()
Thanks,
I think I was blocking that option out as I can't run WSAStartup() in
DllMain. Completely different I know, thanks for clearing my head out.
Clint
-----Original Message-----
From: Simon Fell [mailto:xml@zaks.demon.co.uk]
Sent: Sunday, February 25, 2001 10:45 AM
To: xerces-c-dev@xml.apache.org
Subject: Re: PlatformUtils::Initialize()
i believe that internally now Init / Term is ref counted. However if
you're doing a win32 dll, by far the easiest approach is to just call
Init / Term once in dllmain.
Cheers
Simon
On Sun, 25 Feb 2001 10:35:48 -0700, in xml you wrote:
>Hi all,
> If I'm understanding correctly PlatformUtils::Initialize() can only be
>called once per process, and doing so more than once will cause issues. I'm
>using Xercies in a multithreaded dll and this is a little bit of a pain.
I'm
>planning on using a flag with one of the interlocked functions(Win32) if
>this is truely the case. PlatformUtils is required, right?(I couldn't get
>things working w/o it.)
>
>Thanks, Clint
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
RE: PlatformUtils::Initialize()
Posted by Clint Phillips <cp...@apriva.com>.
Thanks,
I think I was blocking that option out as I can't run WSAStartup() in
DllMain. Completely different I know, thanks for clearing my head out.
Clint
-----Original Message-----
From: Simon Fell [mailto:xml@zaks.demon.co.uk]
Sent: Sunday, February 25, 2001 10:45 AM
To: xerces-c-dev@xml.apache.org
Subject: Re: PlatformUtils::Initialize()
i believe that internally now Init / Term is ref counted. However if
you're doing a win32 dll, by far the easiest approach is to just call
Init / Term once in dllmain.
Cheers
Simon
On Sun, 25 Feb 2001 10:35:48 -0700, in xml you wrote:
>Hi all,
> If I'm understanding correctly PlatformUtils::Initialize() can only be
>called once per process, and doing so more than once will cause issues. I'm
>using Xercies in a multithreaded dll and this is a little bit of a pain.
I'm
>planning on using a flag with one of the interlocked functions(Win32) if
>this is truely the case. PlatformUtils is required, right?(I couldn't get
>things working w/o it.)
>
>Thanks, Clint
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Re: PlatformUtils::Initialize()
Posted by Simon Fell <xm...@zaks.demon.co.uk>.
i believe that internally now Init / Term is ref counted. However if
you're doing a win32 dll, by far the easiest approach is to just call
Init / Term once in dllmain.
Cheers
Simon
On Sun, 25 Feb 2001 10:35:48 -0700, in xml you wrote:
>Hi all,
> If I'm understanding correctly PlatformUtils::Initialize() can only be
>called once per process, and doing so more than once will cause issues. I'm
>using Xercies in a multithreaded dll and this is a little bit of a pain. I'm
>planning on using a flag with one of the interlocked functions(Win32) if
>this is truely the case. PlatformUtils is required, right?(I couldn't get
>things working w/o it.)
>
>Thanks, Clint
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org