Boost logo

Boost Users :

From: Topi Mäenpää (topi.maenpaa_at_[hidden])
Date: 2005-11-08 04:22:51


Debugging continues...

> No, it didn't work... I also exported the extended_type_info subclasses
> (_0 and _1) from my DLL, but I still encounter the same problems.
>
> The code lacks comments, and I find it difficult to study some some of
> the constructs. It seems that whenever I register a class, its
> superclasses get registered as well. The extended_type_info pointer for
> my common superclase is however different for each instantiation. The
> exe crashes due to an unhandled unregistered_cast exception thrown at
> oserializer.hpp:408. Thus, it seems that downcasting cannot succeed. I
> even modified the extended_type_info so that it always compares keys
> literally instead of pointers, but this has no effect. Furthermore, I
> changed the tkmap and ktmap multisets to sets. I assumed this could
> prevent multiple registrations, but it does not.

void_caster_registry does not contain valid entries. Whenever a
base-derived relationship crosses a DLL boundary, the correct pair isn't
inserted to the registry. Instead, the extended_type_info for the base
class points to a different object than the extended_type_info of the
real base class. Since the base class isn't exported in the exe/other
dll, there is no object key, and the extended_type_info objects cannot
be matched with them (I have changed the comparison operator to match
the keys because the pointers won't match anyway.)

Could this be related to the fact that the low-level type_info pointer
for the classes is different in the dll and the exe? (This is also the
reason why dynamic_cast doesn't work across dynamic library boundaries.)
Is it possible to use the non-rtti versions with MSVC 7.1?

> Could someone point me out a way to work around this? Any temporary
> solution will do until the problem has been identified and fixed.

I have dug deep into the library but have not been able to identify the
problem. I'm getting a bit frutsrated... Any help will be appreciated.

-- 
Topi Mäenpää
CTO, Intopii
+358 40 774 7749

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