STL and Glibmm



Hi,

when I first saw that Gtkmm was using wrappers to handle conversions to STL containers, I thought that it was expected, because Visual C++'s STL implementation is not fully compatible with the DLL import/export system.

Up to now, I was using STLport to enable the use of STL in my DLLs (thus I had to recompile Gtkmm with STLport…) and I'm currently looking for another solution. I tried to look at how Glibmm does it and I'm quite confused.

It should be OK to work with vectors, provided you export the right symbols. I suppose gendef does this, but it's difficult to check since the symbols are mangled.

According to MSDN, it should be totally impossible to use maps in the API, however in markup.h (version 2.28.2), there is a typedef on a map: typedef std::map<Glib::ustring, Glib::ustring, Glib::Markup::AttributeKeyLess> AttributeMap;
This type is then used in a method of the class Parser:
virtual void on_start_element(ParseContext& context,
const Glib::ustring& element_name,
const AttributeMap& attributes);

This is the same as passing a reference to a map from the main program to the DLL, which should cause an undefined behaviour (in my past experience it always caused a crash).

Is it a bug? If not, does someone know why/how it works?

Thanks a lot,
yann


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]