There are a couple of main reasons why I am still not using Juce near exclusively over MFC. These are maps, lists, and MFC’s Serialization (Rich Edit controls would be nice too ).
Maps, MFC Style, I use often, especially for something I just did, it holds about 700k string keys/values. I do a large number of lookups, exceedingly large, putting these in any other format of lookup would take a lot longer then the current seven seconds to load.
Lists, don’t use often, but MFC’s way about them is unique, and described in the serialization area.
Everything of value(?) in MFC is derived from CObject. CObject has a Serialization function which should be derived from. It can be setup so you can do a dump of near anything, to memory, file, wherever, and reload it later to bring any object to its previous state. Doing this in your own things is easy, and for my latest project would be a synch to emulate, except for two major hurdles. CArchive is the main function that is used for serialization, and you can pass in any CObject derived class for it to serialize or unserialize. In my project I have it archive out three variables, one array (MFC templated array, mine is defined as CArray<binStruct,binStruct>), and one map (CMapStringToString). What’s nice is that my serialization function is as follows:
Serialize(CArchive& ar)
{
if( ar.IsStoring() )
{
ar << m_SelectedObject;
ar << m_IsLoaded;
ar << m_NumberOfObjects;
m_Objects.Serialize(ar);
m_Lang.Serialize(ar);
}
else if( ar.IsLoading() )
{
ar >> m_SelectedObject;
ar >> m_IsLoaded;
ar >> m_NumberOfObjects;
m_Objects.Serialize(ar);
m_Lang.Serialize(ar);
}
}
It saves and loads my state quite well (I rebuild the rest of the classes and informationlater in the function, snipped out, from the serialized data). I could emulate this well enough in Juce, except I havn’t found any array or map, except for the one’s in mfc, that can dump and reload their information like that. I’ve been thinking, what about a pseudo class (like multi-subclassing a listener) for serialization, and a number of classes would subclass it already, such as your array classes and such. Mayhaps putting in a map, from like the standard set, with such functionality, duplicating some of the ones from MFC, such as the string/string one?