Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Re: STL objects...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 24 Topic 45764 of 47006
Post > Topic >>

Re: STL objects and binary compatibility

by Joe Greer <jgreer@[EMAIL PROTECTED] > May 7, 2008 at 03:12 PM

osama178@[EMAIL PROTECTED]
 wrote in news:06aeb05a-483c-4503-b190-
81c4bb4c711b@[EMAIL PROTECTED]
>  further reading are greatly appreciated.
>>
>> It sounds like you're a little confused.
>>
>> Binary compatablity usually is associated with a context.
>>
>> If you build with different versions of the STL or with various options
>> that render binary incompatibility, then this is your choice.
>>
>> Please elaborate what you're really concerned about.
> 
> Sorry my question was not very clear. In other words, can STL Objects
> cross DLL boundaries. For example. Can we pass STL objects between
> different binaries by reference safely?
> 

Yes, no, maybe.  Since you use the term DLL, I will assume that you are 
talking windows.  The problems you can have under windows have to do with 
memory allocation.  If you pass a collection to a dll and it adds an
object 
to it and if that addition causes the collection to allocate memory, then 
since it is using code compiled into the dll, it will allocate memory from

the dll's heap and return it to the main program.  This can cause problems

with memory accounting when the collection is later freed.  Especially if 
the dll is unloaded before the collection is destroyed.  This effect can
be 
reduced if you use the DLL version of the crt for all dlls and the exe.  
This is because the memory for everything then comes from the crt dll 
rather than the individual dll/exe.  Along those same lines, if you plan
on 
unloading your dlls make very sure that every object allocated from that 
dll has been destroyed first or you will get a fault when you eventually
do 
get around to destroying those objects.  Something about the destructors 
not being loaded into memory any more makes the system get upset. :)

HTH,
joe
 




 24 Posts in Topic:
STL objects and binary compatibility
osama178@[EMAIL PROTECTED  2008-05-05 20:40:22 
Re: STL objects and binary compatibility
Gianni Mariani <gi4nos  2008-05-06 05:56:23 
Re: STL objects and binary compatibility
James Kanze <james.kan  2008-05-06 02:52:52 
Re: STL objects and binary compatibility
osama178@[EMAIL PROTECTED  2008-05-06 10:29:14 
Re: STL objects and binary compatibility
Gianni Mariani <gi4nos  2008-05-06 19:10:54 
Re: STL objects and binary compatibility
Ian Collins <ian-news@  2008-05-07 07:34:57 
Re: STL objects and binary compatibility
Joe Greer <jgreer@[EMA  2008-05-07 15:12:14 
Re: STL objects and binary compatibility
James Kanze <james.kan  2008-05-07 02:08:24 
Re: STL objects and binary compatibility
Paavo Helde <nobody@[E  2008-05-08 16:08:06 
Re: STL objects and binary compatibility
osama178@[EMAIL PROTECTED  2008-05-07 14:23:58 
Re: STL objects and binary compatibility
Joe Greer <jgreer@[EMA  2008-05-08 17:02:15 
Re: STL objects and binary compatibility
James Kanze <james.kan  2008-05-09 05:20:59 
Re: STL objects and binary compatibility
Paavo Helde <nobody@[E  2008-05-12 01:15:39 
Re: STL objects and binary compatibility
James Kanze <james.kan  2008-05-12 02:57:18 
Re: STL objects and binary compatibility
Paavo Helde <nobody@[E  2008-05-12 18:35:10 
Re: STL objects and binary compatibility
Triple-DES <DenPlettfr  2008-05-12 22:36:30 
Re: STL objects and binary compatibility
Paavo Helde <nobody@[E  2008-05-13 03:10:55 
Re: STL objects and binary compatibility
James Kanze <james.kan  2008-05-13 03:20:37 
Re: STL objects and binary compatibility
Paavo Helde <nobody@[E  2008-05-13 12:27:43 
Re: STL objects and binary compatibility
"kwikius" <a  2008-05-13 20:19:35 
Re: STL objects and binary compatibility
ajalkane <ajalkane@[EM  2008-05-13 21:57:04 
Re: STL objects and binary compatibility
Ian Collins <ian-news@  2008-05-14 17:34:59 
Re: STL objects and binary compatibility
James Kanze <james.kan  2008-05-14 02:04:10 
Re: STL objects and binary compatibility
James Kanze <james.kan  2008-05-14 02:13:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 1:55:47 CDT 2008.