Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C++ Libraries / February 2004

Tip: Looking for answers? Try searching our database.

Passing STL references across DLL boundaries in VS.Net 2003 (VC++ 7.1)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ross Burns - 18 Feb 2004 04:31 GMT
I am thinking about moving my app to VC++ 7.1 - I wanted to know if
the annoying problem of access violations when passing STL-related
structures across DLL-EXE boundaries and accessing them has been
resolved (assume both link to the same CRT). Thanks!
Doug Harrison [MVP] - 18 Feb 2004 05:10 GMT
>I am thinking about moving my app to VC++ 7.1 - I wanted to know if
>the annoying problem of access violations when passing STL-related
>structures across DLL-EXE boundaries and accessing them has been
>resolved (assume both link to the same CRT). Thanks!

Assuming you mean "same CRT DLL" when you say "same CRT", I believe the
answer to your question is "yes". You'll never be able to do this linking
statically.

Also, which version are you using now that has the problem, and which
classes are you talking about? There are some fixes posted here for VC5/VC6,
and "Fix to <xtree>" solves the problem for the associative containers:

http://www.dinkumware.com/vc_fixes.html

Signature

Doug Harrison
Microsoft MVP - Visual C++

tom_usenet - 19 Feb 2004 12:08 GMT
>>I am thinking about moving my app to VC++ 7.1 - I wanted to know if
>>the annoying problem of access violations when passing STL-related
[quoted text clipped - 4 lines]
>answer to your question is "yes". You'll never be able to do this linking
>statically.

Unless you use a custom allocator (that uses OS memory
allocation/deallocation functions), which is a pain without template
typedefs.

Tom

C++ FAQ: http://www.parashift.com/c++-faq-lite/
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
Doug Harrison [MVP] - 19 Feb 2004 18:49 GMT
>>>I am thinking about moving my app to VC++ 7.1 - I wanted to know if
>>>the annoying problem of access violations when passing STL-related
[quoted text clipped - 8 lines]
>allocation/deallocation functions), which is a pain without template
>typedefs.

Chances are, someone who wants to share STL objects across module boundaries
will share other CRT state, so the only solution I'd consider would be
linking to the same CRT DLL. In addition, the allocator solution might work
for vector<int,A>, but it might not help vector<T,A> where T does memory and
other resource allocation internally.

Signature

Doug Harrison
Microsoft MVP - Visual C++


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.