+void wxObject::StoreObject( wxObjectOutputStream& stream )
+{
+ DEBUG_PRINTF(wxObject::StoreObject)
+
+ wxString obj_name = wxString(GetClassInfo()->GetClassName()) + "_Serialize";
+ wxLibrary *lib = wxTheLibraries.LoadLibrary("wxserial");
+
+ if (!lib) {
+ wxLogError(_("Can't load wxSerial dynamic library."));
+ return;
+ }
+ if (!m_serialObj) {
+ m_serialObj = (WXSERIAL(wxObject) *)lib->CreateObject( obj_name );
+
+ if (!m_serialObj) {
+ wxLogError(_("Can't find the serialization object '%s' "
+ "for the object '%s'."),
+ obj_name.c_str(),
+ GetClassInfo()->GetClassName());
+ return;
+ }
+ m_serialObj->SetObject(this);
+ }
+
+ m_serialObj->StoreObject(stream);
+}
+
+void wxObject::LoadObject( wxObjectInputStream& stream )
+{
+ DEBUG_PRINTF(wxObject::LoadObject)
+
+ wxString obj_name = wxString(GetClassInfo()->GetClassName()) + "_Serialize";
+ wxLibrary *lib = wxTheLibraries.LoadLibrary("wxserial");
+
+ if (!m_serialObj) {
+ m_serialObj = (WXSERIAL(wxObject) *)lib->CreateObject( obj_name );
+
+ if (!m_serialObj) {
+ wxLogError(_("Can't find the serialization object '%s' "
+ "for the object '%s'."),
+ obj_name.c_str(),
+ GetClassInfo()->GetClassName());
+ return;
+ }
+ m_serialObj->SetObject(this);
+ }
+
+ m_serialObj->LoadObject(stream);
+}
+
+#endif // wxUSE_SERIAL