Thanks.
-----Original Message-----
From: Maxim Volkonovsky [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 08, 2001 1:22 AM
To: Mitchell, Raymond
Cc: '[EMAIL PROTECTED]'
Subject: Re[2]: Problem initializing and terminating XMLPlatformUtils
more th an o nce in a program
Hello Raymond,
Tuesday, May 08, 2001, you wrote:
MR> Thanks. I realize now that this is covered in the FAQ. I actually do
have
MR> a need to initialize and terminate the utilities multiple times in a
single
MR> process. I have several different libraries that use Xerces-C, each
needing
[...]
As for Win32 platform the right way is to implement DllMain function
somewhere in the Win32PlatformUtils.cpp to handle xerces dll loading
and unloading events:
BOOL WINAPI DllMain(
HINSTANCE hinstDLL, // handle to the DLL module
DWORD fdwReason, // reason for calling function
LPVOID lpvReserved) { // reserved
switch(fdwReason) {
case DLL_PROCESS_ATTACH:
XMLPlatformUtils::Initialize();
break;
case DLL_PROCESS_DETACH:
XMLPlatformUtils::Terminate();
break;
}
return TRUE;
}
Having that you may use xerces in your modules without initialization,
or call Init/Term with no risc of deinitialization in the middle of
the way. I think that the same approach clould be used for other
platforms.
Best regards, mailto:[EMAIL PROTECTED]
Maxim
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]