More STL & DLL issues 
Author Message
 More STL & DLL issues

Hello,

I'm using vc5sp3, STL, and a lot of dll's.

1) In the dll's we have exported classes that only modify STL object
references passed into from the caller. (mostly string references). As far
as I can tell, this is safe to do because we only link to the C runtime
dlls?

2) At first it seemed that the best solution to using the fixed versions of
the STL from Plauger by making the compiler explicitly compile the STL
statically by manipulating the CRTIMP and XDLL(?) defines and including the
STL headers all in one place. However, because we pass string's around a lot
between dll's, it seems that this solution doesn't work?  So it appears that
I'm left with the old (& uglier) possible solutions:

a) Derive off of basic_string<char> as say my_string and only use my_string
in the project. In my_string, override assign() to erase the string before
calling the base class member. I think this will have a large performance
impact depending on how often you assign literals to non-empty strings. I
guess I could be smarter about the work around and only erase it if it's
currently sharing a reference.

b) Manually erase strings only at the places where I think the bug can
occur. This is highly annoying!

c) Other solutions? Since we mostly pass string's around, it might be
practical to wrap the string class into a dll that all the projects share.
What do you think?

This is getting to be a real pain. Any suggestions, comments are greatly
appreciated!

Thanks,
-Edward



Sun, 06 May 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. STL & DLL step 2

2. STL & DLL

3. STL & DLLs

4. stl && msdn library

5. Using STL and ATL and size issue

6. Issues with VC's implementation of STL?

7. VC STL issue -- Is this a Bug ?

8. heap corruption issues with VC++.NET and STL

9. Relative performance issues between STL and MFC

10. Using STL and ATL and size issue

11. STL ISSUE

12. STL - MSVCP60.DLL and MSCVRT.DLL

 

 
Powered by phpBB® Forum Software