
"Neal D. Becker" <ndbecker2@verizon.net> wrote in message news:chl384$cvr$1@sea.gmane.org...
Jonathan Turkanis wrote:
"Jeff Flinn" <TriumphSprint2000@hotmail.com> wrote in message news:ch22j5$qr8$1@sea.gmane.org...
I've tried to replace a couple of existing derived stream/streambuf classes that are used with boost::serialization i/o archives to support Drag/Drop/Copy/Paste in an MFC application.
The Drop/Paste side works great and significantly simplifies and reduces the amount of code req'd:
I glad to hear it.
Unfortunately, the Drag/Copy side produces a access violation in the std::locale copy constructor, when boost::io::detail::indirect_streambuf::imbue calls std::basic_streambuf::pbuimbue. I've tried the following with both binary/text archive types:
At some point I accidentally erased the initialization of the pointer next_ in the indirect_streambuf member initialization list. It should be patched as follows:
----
diff -u -r1.5 indirect_streambuf.hpp --- indirect_streambuf.hpp 31 Aug 2004 18:51:32 -0000 1.5 +++ indirect_streambuf.hpp 31 Aug 2004 18:51:41 -0000 @@ -142,7 +142,7 @@
template<typename T, typename Tr, typename Alloc, typename Mode> indirect_streambuf<T, Tr, Alloc, Mode>::indirect_streambuf() - : pback_size_(0), flags_(0) { } + : next_(0), pback_size_(0), flags_(0) { }
I had been getting segfault during destruction coming from imbue, this probably explains it.
Yep, sorry. Jonathan