I don't know if you're right or not( haven't tried it ), but there is one
thing I think you should be aware of when linking the runtime( and its not
MFC. its the C/C++ runtime. MFC is in MFC42.dll ) statically vs.
dynamically.  If you choose to link the runtime statically, every load
module( dll or exe ) gets its own copy of the runtime. Because of that,
each load module gets its own heap. One side effect of this is that memory
allocated in one load module can't be released in another. So, if you call
a function that returns a pointer to memory, only the load module that
allocated that memory can release it.  Because of that, we always link the
runtime dynamically.  That way, there is only 1 copy of the runtime, only 1
heap, and you don't have a problem releasing memory passed back via a
function from another load module. This could cause you a problem if you
rebuild Xerces with the runtime statically linked.  For example, the
XMLString::replicate methods that take 1 argument both return a pointer to
dynamically allocated memory.  The documentation specifies that it is the
callers responsibility to delete that memoy when it is no longer needed.
If you don't link both your application and Xerces with the dynamic version
of the runtime, you won't be able to do that.  You can probably get around
that problem by using a MemoryManager object.  Presumably, that object
would be completely implemented in one load module, so all
allocations/releases would occur there.  I haven't done that because I did
most of our Xerces code in version 2.1, before the MemoryManager class was
created.


Hope that helped( or, at least, didn't confuse you too much! )

Marc Robertson
Principal Architect
AWD Development
DST Systems, Inc.


                                                                           
             "Milan Tomic"                                                 
             <[EMAIL PROTECTED]                                             
             >                                                          To 
                                       <[EMAIL PROTECTED]>       
             03/18/2004 07:29                                           cc 
             AM                                                            
                                                                   Subject 
                                       RE: VC6 build                       
             Please respond to                                             
             [EMAIL PROTECTED]                                             
                apache.org                                                 
                                                                           
                                                                           
                                                                           





    Exe? I was beliving that the difference between those two options are
how MSVCRT.dll will be linked into Xerces dll: dinamically (Multithreaded
DLL) or statically (Multithreaded). My problem is that when I use
Multithreaded DLL (dinamic MSVCRT.dll linkage) - then VC6 can't link MFC
statically (and I really need it). Am I right?

Best regards,
Milan

 -----Original Message-----
 From: Adam Heinz [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 18, 2004 2:23 PM
 To: [EMAIL PROTECTED]
 Subject: RE: VC6 build

 I don't think it makes any sense to compiles Xerces as a multithreaded
 executable.

 Adam Heinz
 Senior Software Developer
 Exstream Software
       -----Original Message-----
       From: Milan Tomic [mailto:[EMAIL PROTECTED]
       Sent: Thursday, March 18, 2004 8:20 AM
       To: Xerces-C
       Subject: VC6 build




               What is the difference between "Multithreaded" (/MT) and
       "Multithreaded DLL" (/MD) compiler option? Can I compile Xerces 2.5
       using "Multithreaded" option, instead of default "Multithread DLL"?


       Thank you,
       Milan




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

Reply via email to