Index: trunk/MagicSoft/Mars/mbase/MParEnv.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParEnv.cc	(revision 9268)
+++ trunk/MagicSoft/Mars/mbase/MParEnv.cc	(revision 9269)
@@ -150,4 +150,8 @@
 // the result must inherit from fClassName.
 //
+// After successfull creation of the new class (or if a class was set already
+// before and not overwritten in the resource file) the container's ReadEnv
+// is called.
+//
 // WARNING: Especially in the second case oyu can do weird thing which
 //          in principle can result in crashes. Please be extra-carefull.
@@ -178,15 +182,23 @@
     }
 
-    if (!rc)
+    if (!rc && !fCont) // FIXME: fAllowEmpty
         return kFALSE;
 
-    SetCont(cont);
-    if (!fCont)
-    {
-        if (cont)
-            delete cont;
+    if (rc)
+    {
+        SetCont(cont);
+        if (!fCont)
+        {
+            if (cont)
+                delete cont;
+            return kERROR;
+        }
+        fIsOwner = kTRUE;
+    }
+
+    const Int_t res = fCont->ReadEnv(env, prefix, print);
+    if (res==kERROR)
         return kERROR;
-    }
-    fIsOwner = kTRUE;
-    return kTRUE;
-}
+
+    return rc ? rc : res;
+}
