Boost logo

Boost Users :

From: Sergey Skorniakov (s.skorniakov_at_[hidden])
Date: 2005-09-21 04:13:07


>> I think I resolved the issue. The problem is that if the base class A
>> is defined in the main executable, the dynamically loaded DLL
>> apparently uses a different address space for the definition. Even if
>> I return a pointer to A from the DLL, I get an unregistered void cast
>> exception. (I don't know why. Anyone?) If I define the base class in
>> yet another DLL that both the main program and the dynamically loaded
>> DLL link to, serialization works just fine.
>
> This is very odd to me - how does B compile in the DLL without
>
> This is still a murkey area. I believe there are still unresolved issues
> here.
>

I am also encountered the same problem yesterday. The source of evil seems
to be in double registration if rtti-enabled class serialized both in dll
and in exe. void extended_type_info::self_register() just called twice -
from exe and from dll.
 Later, code such
const boost::serialization::extended_type_info * this_type =
boost::serialization::type_info_implementation<T>::type::get_instance();
const boost::serialization::extended_type_info * true_type =
boost::serialization::type_info_implementation<T>::type::get_derived_extended_type_info(t);
if(*this_type == *true_type){...

works wrong because extended_type_info::operator=(const extended_type_info
&rhs) uses just an address of extended_type_info, which can be different in
such situation.
I had attached sample files illustrating problem.







Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net