Index: cpp/frams/Makefile-SDK-files
===================================================================
--- cpp/frams/Makefile-SDK-files	(revision 371)
+++ cpp/frams/Makefile-SDK-files	(revision 372)
@@ -2,5 +2,5 @@
 
 # ALL_DIRS is later expanded by the shell, no spaces/newlines allowed, or it breaks
-ALL_DIRS={common,frams,frams/canvas,frams/config,frams/errmgr,frams/genetics,frams/genetics/f0,frams/genetics/f1,frams/genetics/f2,frams/genetics/f3,frams/genetics/f4,frams/genetics/f5,frams/genetics/f6,frams/genetics/f7,frams/genetics/f8,frams/genetics/f9,frams/genetics/fF,frams/genetics/fT,frams/model,frams/neuro,frams/neuro/impl,frams/param,frams/test,frams/util,frams/vm/classes,frams/virtfile,frams/_demos,frams/model/geometry,frams/_demos/geometry,frams/model/similarity,frams/model/similarity/SVD}
+ALL_DIRS={common,frams,frams/canvas,frams/config,frams/mhandlers,frams/genetics,frams/genetics/f0,frams/genetics/f1,frams/genetics/f2,frams/genetics/f3,frams/genetics/f4,frams/genetics/f5,frams/genetics/f6,frams/genetics/f7,frams/genetics/f8,frams/genetics/f9,frams/genetics/fF,frams/genetics/fT,frams/model,frams/neuro,frams/neuro/impl,frams/param,frams/test,frams/util,frams/vm/classes,frams/virtfile,frams/_demos,frams/model/geometry,frams/_demos/geometry,frams/model/similarity,frams/model/similarity/SVD}
 
 GENMANF4=frams/genetics/f4/oper_f4.o
@@ -19,5 +19,5 @@
 GENMAN_COMMON_OBJS=frams/genetics/genman.o frams/param/mutableparam.o frams/param/mutparamlist.o frams/neuro/geneticneuroparam.o frams/neuro/neurolibparam.o
 
-SDK_OBJS=frams/util/list.o frams/util/advlist.o frams/param/param.o frams/util/sstring.o frams/util/sstringutils.o frams/util/3d.o frams/vm/classes/3dobject.o frams/model/model.o frams/model/modelparts.o frams/neuro/neurolibrary.o frams/genetics/geno.o frams/genetics/genoconv.o frams/util/extvalue.o frams/vm/classes/collectionobj.o frams/util/hashtable.o common/framsg.o common/stl-util.o common/nonstd_stdio.o frams/util/callbacks.o frams/param/syntparam.o frams/util/multirange.o frams/util/multimap.o frams/param/paramtabobj.o frams/errmgr/errmanager.o frams/param/paramobj.o frams/genetics/oper_fx.o common/nonstd_math.o frams/errmgr/stderrors.o common/Convert.o frams/util/rndutil.o
+SDK_OBJS=frams/util/list.o frams/util/advlist.o frams/param/param.o frams/util/sstring.o frams/util/sstringutils.o frams/util/3d.o frams/vm/classes/3dobject.o frams/model/model.o frams/model/modelparts.o frams/neuro/neurolibrary.o frams/genetics/geno.o frams/genetics/genoconv.o frams/util/extvalue.o frams/vm/classes/collectionobj.o frams/util/hashtable.o common/hmessage.o common/stl-util.o common/nonstd_stdio.o frams/util/callbacks.o frams/param/syntparam.o frams/util/multirange.o frams/util/multimap.o frams/param/paramtabobj.o frams/mhandlers/mhandlers.o frams/param/paramobj.o frams/genetics/oper_fx.o common/nonstd_math.o frams/mhandlers/stderrors.o common/Convert.o frams/util/rndutil.o
 
 GEOMETRY_OBJS=frams/model/geometry/meshbuilder.o frams/model/geometry/modelgeometryinfo.o frams/model/geometry/geometryutils.o
@@ -25,29 +25,29 @@
 #### sdk_tests
 
-GENOMANIPULATION_OBJS= frams/_demos/genomanipulation.o frams/errmgr/stdouterr.o frams/virtfile/virtfile.o  $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)
+GENOMANIPULATION_OBJS= frams/_demos/genomanipulation.o frams/mhandlers/stdouthandler.o frams/virtfile/virtfile.o  $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)
 
-MULTILINE_F0_OBJS=frams/_demos/multiline_f0_test.o frams/virtfile/stringfile.o frams/virtfile/virtfile.o frams/errmgr/stdouterr.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)
+MULTILINE_F0_OBJS=frams/_demos/multiline_f0_test.o frams/virtfile/stringfile.o frams/virtfile/virtfile.o frams/mhandlers/stdouthandler.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)
 
-F0_VARIANTS_OBJS=frams/_demos/f0_variants_test.o frams/virtfile/stringfile.o frams/virtfile/virtfile.o frams/errmgr/stdouterr.o   $(SDK_OBJS) $(GENOCONV_SDK_OBJS)
+F0_VARIANTS_OBJS=frams/_demos/f0_variants_test.o frams/virtfile/stringfile.o frams/virtfile/virtfile.o frams/mhandlers/stdouthandler.o   $(SDK_OBJS) $(GENOCONV_SDK_OBJS)
 
 LOADER_TEST_OBJS=frams/_demos/genotypeloader.o frams/_demos/loader_test.o frams/virtfile/virtfile.o frams/param/multiparamload.o frams/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS)
 
-LOADER_TEST_PARAM_OBJS=frams/_demos/loader_test_param.o frams/virtfile/virtfile.o frams/param/multiparamload.o frams/virtfile/stdiofile.o frams/errmgr/stdouterr.o $(SDK_OBJS)
+LOADER_TEST_PARAM_OBJS=frams/_demos/loader_test_param.o frams/virtfile/virtfile.o frams/param/multiparamload.o frams/virtfile/stdiofile.o frams/mhandlers/stdouthandler.o $(SDK_OBJS)
 
-GENOCONV_TEST_OBJS= frams/_demos/genoconv_test.o frams/_demos/printconvmap.o frams/errmgr/stdouterr.o frams/virtfile/virtfile.o  $(SDK_OBJS) $(GENOCONV_SDK_OBJS)
+GENOCONV_TEST_OBJS= frams/_demos/genoconv_test.o frams/_demos/printconvmap.o frams/mhandlers/stdouthandler.o frams/virtfile/virtfile.o  $(SDK_OBJS) $(GENOCONV_SDK_OBJS)
 
-GENO_TEST_OBJS= frams/_demos/geno_test.o frams/virtfile/virtfile.o frams/errmgr/stdouterr.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)
+GENO_TEST_OBJS= frams/_demos/geno_test.o frams/virtfile/virtfile.o frams/mhandlers/stdouthandler.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)
 
-GENOOPER_TEST_OBJS=frams/_demos/genooper_test.o frams/virtfile/virtfile.o frams/errmgr/stdouterr.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)
+GENOOPER_TEST_OBJS=frams/_demos/genooper_test.o frams/virtfile/virtfile.o frams/mhandlers/stdouthandler.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)
 
 GENOOPER_TEST_FTEST_OBJS=frams/_demos/genooper_test_fTest.o frams/virtfile/virtfile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) $(GENMAN_FT)
 
-NEURO_TEST_OBJS= frams/_demos/neuro_test.o frams/errmgr/stdouterr.o frams/virtfile/virtfile.o \
+NEURO_TEST_OBJS= frams/_demos/neuro_test.o frams/mhandlers/stdouthandler.o frams/virtfile/virtfile.o \
 	frams/neuro/neuroimpl.o frams/neuro/neurofactory.o frams/neuro/impl/neuroimpl-simple.o frams/neuro/impl/neuroimpl-channels.o \
 	frams/neuro/impl/neuroimpl-fuzzy.o frams/neuro/impl/neuroimpl-fuzzy-f0.o  $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)
 
-FULL_PROPS_OBJS= frams/_demos/full_props.o frams/errmgr/stdouterr.o frams/virtfile/virtfile.o  frams/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)
+FULL_PROPS_OBJS= frams/_demos/full_props.o frams/mhandlers/stdouthandler.o frams/virtfile/virtfile.o  frams/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)
 
-SHAPECONVERT_OBJS= frams/_demos/shapeconvert.o frams/errmgr/stdouterr.o frams/virtfile/virtfile.o  frams/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)
+SHAPECONVERT_OBJS= frams/_demos/shapeconvert.o frams/mhandlers/stdouthandler.o frams/virtfile/virtfile.o  frams/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)
 
 SERIAL_TEST_OBJS= frams/_demos/serial_test.o frams/virtfile/virtfile.o  $(SDK_OBJS) $(GENOCONV_SDK_OBJS)
@@ -55,5 +55,5 @@
 PART_SHAPES_OBJS= frams/_demos/part_shapes.o frams/virtfile/virtfile.o  $(SDK_OBJS) $(GENOCONV_SDK_OBJS)
 
-NEURO_LAYOUT_TEST_OBJS= frams/_demos/neuro_layout_test.o frams/virtfile/virtfile.o frams/errmgr/stdouterr.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) frams/canvas/nn_layout_model.o frams/canvas/nn_simple_layout.o frams/canvas/nn_smart_layout.o
+NEURO_LAYOUT_TEST_OBJS= frams/_demos/neuro_layout_test.o frams/virtfile/virtfile.o frams/mhandlers/stdouthandler.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS) frams/canvas/nn_layout_model.o frams/canvas/nn_simple_layout.o frams/canvas/nn_smart_layout.o
 
 GEOMETRY_INFO_TEST_OBJS=frams/_demos/geometry/info_test.o frams/_demos/geometry/geometrytestutils.o frams/_demos/genotypeloader.o frams/virtfile/virtfile.o frams/param/multiparamload.o frams/virtfile/stdiofile.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GEOMETRY_OBJS)
@@ -66,5 +66,5 @@
 
 SIMIL_TEST_OBJS=frams/_demos/simil_test.o frams/model/similarity/SVD/lapack.o frams/model/similarity/SVD/matrix_tools.o frams/model/similarity/simil_match.o frams/model/similarity/simil_model.o  \
-     frams/_demos/genotypeloader.o frams/virtfile/virtfile.o frams/param/multiparamload.o frams/virtfile/stdiofile.o frams/errmgr/stdouterr.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)
+     frams/_demos/genotypeloader.o frams/virtfile/virtfile.o frams/param/multiparamload.o frams/virtfile/stdiofile.o frams/mhandlers/stdouthandler.o $(SDK_OBJS) $(GENOCONV_SDK_OBJS) $(GENMAN_SDK_OBJS)
 
 SIMIL_UNITTESTS_OBJS=frams/_demos/simil_unittests.o frams/model/similarity/simil_match.o
Index: cpp/frams/Makefile-maintain
===================================================================
--- cpp/frams/Makefile-maintain	(revision 372)
+++ cpp/frams/Makefile-maintain	(revision 372)
@@ -0,0 +1,26 @@
+ifeq "$(SHELL)" "/bin/sh"
+        # because of bash-specific shell expansion used in 'clean':
+	SHELL=/bin/bash
+endif
+
+MISSING_ALL_DIRS=$(strip $(foreach DIR,$(shell echo $(ALL_DIRS)), $(if $(wildcard $(DIR)),,$(DIR))))
+
+clean:
+ifeq "$(ALL_DIRS)$(ALL_DIRS)" ""
+	@echo "Makefile-maintain clean: ALL_DIRS and/or EXTRA_CLEAN_FILES must be defined"
+else
+	@echo -e -n $(if $(MISSING_ALL_DIRS),\\nMissing ALL_DIRS paths:\\n$(MISSING_ALL_DIRS)\\n\\n)
+	rm -f $(EXTRA_CLEAN_FILES) $(ALL_DIRS)/*.{a,o,d}
+endif
+
+ALL_DEPS=$(ALL_OBJS:.o=.d)
+
+ifneq "$(MAKECMDGOALS)" "clean"
+-include $(ALL_DEPS)
+endif
+
+depend: $(ALL_DEPS)
+
+%.d: %.cpp
+	@set -e; rm -f $@; $(CXX) $(CXXFLAGS) -MM -MT $(<:.cpp=.o) $< > $@
+#	g++ $(CXXFLAGS) -MM -MT $(<:.o=.d) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@
Index: cpp/frams/_demos/f0_variants_test.cpp
===================================================================
--- cpp/frams/_demos/f0_variants_test.cpp	(revision 371)
+++ cpp/frams/_demos/f0_variants_test.cpp	(revision 372)
@@ -10,5 +10,5 @@
 #include <frams/genetics/defgenoconv.h>
 #include <frams/model/model.h>
-#include <frams/errmgr/stdouterr.h>
+#include <frams/mhandlers/stdouthandler.h>
 
 void save_as_f0(SString &gen,Model &m,bool omit_default_values)
@@ -74,5 +74,5 @@
 int main(int argc,char*argv[])
 {
-StdoutErrorHandler err;//the default ErrorHandler constructor automatically registers this object to receive framsg messages (and in this case, redirect them to standard output)
+MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable);
 
 //without converters the application would only handle "format 0" genotypes
Index: cpp/frams/_demos/full_props.cpp
===================================================================
--- cpp/frams/_demos/full_props.cpp	(revision 371)
+++ cpp/frams/_demos/full_props.cpp	(revision 372)
@@ -9,5 +9,5 @@
 
 #include <frams/model/model.h>
-#include <frams/errmgr/stdouterr.h>
+#include <frams/mhandlers/stdouthandler.h>
 #include <frams/genetics/preconfigured.h>
 
@@ -50,5 +50,5 @@
 {
 StdioFILE::setStdio();//setup VirtFILE::Vstdin/out/err
-StdoutErrorHandler err(ErrorHandlerBase::DontBlock,VirtFILE::Vstderr); //errors -> stderr, don't interfere with stdout
+MessageHandlerToStdout messages_to_stderr(MessageHandlerBase::Enable | MessageHandlerBase::DontBlock,VirtFILE::Vstderr); //errors -> stderr, don't interfere with stdout
 
 PreconfiguredGenetics genetics;
@@ -79,5 +79,5 @@
 if (!m.isValid())
 	{
-	FMprintf("","full_props",FMLV_ERROR,"Cannot build Model from the supplied genotype\n");
+	Hprintf("","full_props",HMLV_ERROR,"Cannot build Model from the supplied genotype\n");
 	return 2;	
 	}
Index: cpp/frams/_demos/geno_test.cpp
===================================================================
--- cpp/frams/_demos/geno_test.cpp	(revision 371)
+++ cpp/frams/_demos/geno_test.cpp	(revision 372)
@@ -6,5 +6,5 @@
 #include <frams/util/sstringutils.h>
 #include <frams/genetics/preconfigured.h>
-#include <frams/errmgr/stdouterr.h>
+#include <frams/mhandlers/stdouthandler.h>
 
 /**
@@ -18,5 +18,5 @@
 {
 	PreconfiguredGenetics genetics;
-	StdoutErrorHandler stdouterr; //comment this object out to mute error/warning messages
+	MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable); //comment this object out to mute error/warning messages
 
 	if (argc <= 1)
Index: cpp/frams/_demos/genoconv_test.cpp
===================================================================
--- cpp/frams/_demos/genoconv_test.cpp	(revision 371)
+++ cpp/frams/_demos/genoconv_test.cpp	(revision 372)
@@ -9,5 +9,5 @@
 
 #include "printconvmap.h"
-#include <frams/errmgr/stdouterr.h>
+#include <frams/mhandlers/stdouthandler.h>
 
 /**
@@ -117,5 +117,5 @@
 int main(int argc,char *argv[])
 {
-StdoutErrorHandler err;//the default ErrorHandler constructor automatically registers this object to receive framsg messages (and in this case, redirect them to standard output)
+MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable);
 
 DefaultGenoConvManager gcm;
Index: cpp/frams/_demos/genomanipulation.cpp
===================================================================
--- cpp/frams/_demos/genomanipulation.cpp	(revision 371)
+++ cpp/frams/_demos/genomanipulation.cpp	(revision 372)
@@ -10,5 +10,5 @@
 #include <frams/model/model.h>
 #include <frams/genetics/preconfigured.h>
-#include <frams/errmgr/stdouterr.h>
+#include <frams/mhandlers/stdouthandler.h>
 
 /**
@@ -266,5 +266,5 @@
 int main(int argc,char*argv[])
 {
-StdoutErrorHandler err; //redirect model-related errors to stdout
+MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable); //redirect model-related errors to stdout
 
 srand(time(0));
Index: cpp/frams/_demos/genooper_test.cpp
===================================================================
--- cpp/frams/_demos/genooper_test.cpp	(revision 371)
+++ cpp/frams/_demos/genooper_test.cpp	(revision 372)
@@ -3,5 +3,5 @@
 // See LICENSE.txt for details.
 
-#include <frams/errmgr/stdouterr.h>
+#include <frams/mhandlers/stdouthandler.h>
 #include <frams/genetics/preconfigured.h>
 
@@ -21,5 +21,5 @@
 int main(int argc, char *argv[])
 {
-	StdoutErrorHandler err;//the default ErrorHandler constructor automatically registers this object to receive framsg messages (and in this case, redirect them to standard output)
+	MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable);
 	PreconfiguredGenetics genetics;
 
Index: cpp/frams/_demos/loader_test_param.cpp
===================================================================
--- cpp/frams/_demos/loader_test_param.cpp	(revision 371)
+++ cpp/frams/_demos/loader_test_param.cpp	(revision 372)
@@ -5,5 +5,5 @@
 #include <frams/param/multiparamload.h>
 #include <frams/virtfile/stdiofile.h>
-#include <frams/errmgr/stdouterr.h>
+#include <frams/mhandlers/stdouthandler.h>
 
 /**
@@ -66,5 +66,5 @@
 	StdioFILEDontClose virt_stderr(stderr);
 	StdioFILEDontClose virt_stdout(stdout);
-	StdoutErrorHandler error_handler(0, &virt_stderr);
+	MessageHandlerToStdout messages_to_stderr(MessageHandlerBase::Enable, &virt_stderr);
 	StdioFileSystem_autoselect stdiofilesys;
 	MultiParamLoader loader(argv[1]);
Index: cpp/frams/_demos/loader_test_param.in
===================================================================
--- cpp/frams/_demos/loader_test_param.in	(revision 371)
+++ cpp/frams/_demos/loader_test_param.in	(revision 372)
Index: cpp/frams/_demos/multiline_f0_test.cpp
===================================================================
--- cpp/frams/_demos/multiline_f0_test.cpp	(revision 371)
+++ cpp/frams/_demos/multiline_f0_test.cpp	(revision 372)
@@ -10,10 +10,10 @@
 #include <frams/genetics/preconfigured.h>
 #include <frams/model/model.h>
-#include <frams/errmgr/stdouterr.h>
+#include <frams/mhandlers/stdouthandler.h>
 #include <frams/virtfile/stringfile.h>
 
 int main(int argc,char*argv[])
 {
-StdoutErrorHandler err;//the default ErrorHandler constructor automatically registers this object to receive framsg messages (and in this case, redirect them to standard output)
+MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable);
 PreconfiguredGenetics genetics;
 
Index: cpp/frams/_demos/neuro_layout_test.cpp
===================================================================
--- cpp/frams/_demos/neuro_layout_test.cpp	(revision 371)
+++ cpp/frams/_demos/neuro_layout_test.cpp	(revision 372)
@@ -7,5 +7,5 @@
 #include <frams/genetics/preconfigured.h>
 #include <frams/model/model.h>
-#include <frams/errmgr/stdouterr.h>
+#include <frams/mhandlers/stdouthandler.h>
 #include <frams/canvas/nn_layout_model.h>
 
@@ -83,5 +83,5 @@
 int main(int argc,char*argv[])
 {
-StdoutErrorHandler err;//the default ErrorHandler constructor automatically registers this object to receive framsg messages (and in this case, redirect them to standard output)
+MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable);
 PreconfiguredGenetics genetics;
 
Index: cpp/frams/_demos/neuro_test.cpp
===================================================================
--- cpp/frams/_demos/neuro_test.cpp	(revision 371)
+++ cpp/frams/_demos/neuro_test.cpp	(revision 372)
@@ -9,5 +9,5 @@
 #include <frams/neuro/neuroimpl.h>
 #include <frams/neuro/neurofactory.h>
-#include <frams/errmgr/stdouterr.h>
+#include <frams/mhandlers/stdouthandler.h>
 
 /**
@@ -60,5 +60,5 @@
 int main(int argc,char*argv[])
 {
-StdoutErrorHandler err;//the default ErrorHandler constructor automatically registers this object to receive framsg messages (and in this case, redirect them to standard output)
+MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable);
 PreconfiguredGenetics genetics;
 
Index: cpp/frams/_demos/shapeconvert.cpp
===================================================================
--- cpp/frams/_demos/shapeconvert.cpp	(revision 371)
+++ cpp/frams/_demos/shapeconvert.cpp	(revision 372)
@@ -9,5 +9,5 @@
 
 #include <frams/model/model.h>
-#include <frams/errmgr/stdouterr.h>
+#include <frams/mhandlers/stdouthandler.h>
 #include <frams/genetics/preconfigured.h>
 
@@ -34,5 +34,5 @@
 {
 	StdioFILE::setStdio();//setup VirtFILE::Vstdin/out/err
-	StdoutErrorHandler err(ErrorHandlerBase::DontBlock, VirtFILE::Vstderr); //errors -> stderr, don't interfere with stdout
+	MessageHandlerToStdout messages_to_stderr(MessageHandlerBase::Enable | MessageHandlerBase::DontBlock, VirtFILE::Vstderr); //errors -> stderr, don't interfere with stdout
 
 	PreconfiguredGenetics genetics;
@@ -50,5 +50,5 @@
 				if ((shape != Part::SHAPE_ELLIPSOID) && (shape != Part::SHAPE_CUBOID) && (shape != Part::SHAPE_CYLINDER))
 				{
-					FMprintf("", "shapeconvert", FMLV_ERROR, "Invalid shape");
+					Hprintf("", "shapeconvert", HMLV_ERROR, "Invalid shape");
 					return 4;
 				}
@@ -71,5 +71,5 @@
 	if (!m.isValid())
 	{
-		FMprintf("", "shapeconvert", FMLV_ERROR, "Cannot build Model from the supplied genotype");
+		Hprintf("", "shapeconvert", HMLV_ERROR, "Cannot build Model from the supplied genotype");
 		return 2;
 	}
@@ -77,5 +77,5 @@
 	if (m.getShape() != Model::SHAPE_OLD)
 	{
-		FMprintf("", "shapeconvert", FMLV_ERROR, "Only old style shapes can be converted");
+		Hprintf("", "shapeconvert", HMLV_ERROR, "Only old style shapes can be converted");
 		return 3;
 	}
Index: cpp/frams/_demos/simil_test.cpp
===================================================================
--- cpp/frams/_demos/simil_test.cpp	(revision 371)
+++ cpp/frams/_demos/simil_test.cpp	(revision 372)
@@ -5,5 +5,5 @@
 
 #include <vector>
-#include "frams/errmgr/stdouterr.h"
+#include "frams/mhandlers/stdouthandler.h"
 #include "frams/_demos/genotypeloader.h"
 #include "frams/genetics/preconfigured.h"
@@ -39,5 +39,5 @@
 int main(int argc, char *argv[])
 {
-    StdoutErrorHandler stdouterr; //comment this object out to mute error/warning messages 
+    MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable);
     typedef double *pDouble;
     int iCurrParam = 0; // index of the currently processed parameter
Index: cpp/frams/genetics/f1/conv_f1.cpp
===================================================================
--- cpp/frams/genetics/f1/conv_f1.cpp	(revision 371)
+++ cpp/frams/genetics/f1/conv_f1.cpp	(revision 372)
@@ -5,5 +5,5 @@
 #include "conv_f1.h"
 #include <common/nonstd_stl.h>
-#include <common/framsg.h>
+#include <common/hmessage.h>
 #include <frams/util/multirange.h>
 #include <frams/util/multimap.h>
@@ -63,5 +63,5 @@
 		if ((n1<0) || (n2<0) || (n1>=neuro_f1_to_f0.size()) || (n2>=neuro_f1_to_f0.size()))
 			{
-			if (final) FMprintf("GenoConvF1","addInput",FMLV_WARN,
+			if (final) Hprintf("GenoConvF1","addInput",HMLV_WARN,
 					    "illegal neuron connection %d <- %d (ignored)",n1,n2);
 			return 0;
@@ -178,5 +178,5 @@
 		else
 			{
-			FramMessage("GenoConv_F1","grow","Illegal neuron position (ignored)",1);
+			Hmessage("GenoConv_F1","grow","Illegal neuron position (ignored)",1);
 			g=skipNeuro(g+1);
 			}
Index: cpp/frams/genetics/f4/conv_f4.cpp
===================================================================
--- cpp/frams/genetics/f4/conv_f4.cpp	(revision 371)
+++ cpp/frams/genetics/f4/conv_f4.cpp	(revision 372)
@@ -6,5 +6,5 @@
 
 #include "conv_f4.h"
-#include <common/framsg.h>
+#include <common/hmessage.h>
 #include "../oper_fx.h" //for GENOPER_OK constant
 
@@ -110,5 +110,5 @@
 		if (res)
 		{
-			FramMessage("f4_Model", "buildModelRec", "Error in building Model", 2);
+			Hmessage("f4_Model", "buildModelRec", "Error in building Model", 2);
 			error = res;
 			break;
@@ -134,5 +134,5 @@
 			return cells->C[i];
 	// none!
-	FramMessage("f4_Model", "getStick", "Not a single stick", 2);
+	Hmessage("f4_Model", "getStick", "Not a single stick", 2);
 	return NULL;
 }
Index: cpp/frams/genetics/f4/f4_general.cpp
===================================================================
--- cpp/frams/genetics/f4/f4_general.cpp	(revision 371)
+++ cpp/frams/genetics/f4/f4_general.cpp	(revision 372)
@@ -7,5 +7,5 @@
 #include "f4_general.h"
 #include <common/nonstd_stl.h>
-#include <common/framsg.h>
+#include <common/hmessage.h>
 #include <frams/model/model.h> // for min and max attributes
 #include "../oper_fx.h" //for GENOPER_ constants
@@ -581,5 +581,5 @@
 			char buf[40];
 			sprintf(buf, "unknown code '%c'", gcur->name);
-			FramMessage("f4_Cell", "onestep", buf, 2);
+			Hmessage("f4_Cell", "onestep", buf, 2);
 			// fix: delete it
 			org->setRepairRemove(gcur->pos, gcur);
Index: cpp/frams/genetics/f4/oper_f4.cpp
===================================================================
--- cpp/frams/genetics/f4/oper_f4.cpp	(revision 371)
+++ cpp/frams/genetics/f4/oper_f4.cpp	(revision 372)
@@ -8,5 +8,5 @@
 #include "oper_f4.h"
 #include <frams/util/sstring.h>
-#include <common/framsg.h>
+#include <common/hmessage.h>
 
 #include <stdio.h>
@@ -51,5 +51,5 @@
 	mutation_method_names[index++] = "deleted a node";
 	mutation_method_names[index++] = "modified a node";
-	if (index != F4_COUNT + F4_ADD_COUNT - 1) FramMessage("Geno_f4", "Constructor", "Mutation names init error", 3);
+	if (index != F4_COUNT + F4_ADD_COUNT - 1) Hmessage("Geno_f4", "Constructor", "Mutation names init error", 3);
 }
 
Index: cpp/frams/genetics/genman.cpp
===================================================================
--- cpp/frams/genetics/genman.cpp	(revision 371)
+++ cpp/frams/genetics/genman.cpp	(revision 372)
@@ -6,8 +6,8 @@
 #include <frams/vm/classes/genoobj.h>
 #include GEN_CONFIG_FILE //configuration of active genetic operators
-#include "common/framsg.h"
+#include "common/hmessage.h"
 #include "common/nonstd_math.h"
 #include "common/stl-util.h"
-#include <frams/errmgr/errmanager.h>
+#include <frams/mhandlers/mhandlers.h>
 
 
@@ -267,5 +267,5 @@
 		if (gf->mutate(gn, chg, method) == GENOPER_OK)
 		{
-			ErrorHandler eh(ErrorHandler::StoreFirstMessage); //mute testValidity()
+			MessageHandlerToMemory eh(MessageHandlerBase::Enable | MessageHandlerToMemory::StoreFirstMessage); //mute testValidity()
 			Geno G(gn, gv.getFormat(), "", "");
 			canvalidate = true;
@@ -284,5 +284,5 @@
 		if (!ok && (count - pcount > 100))
 		{
-			FMprintf("GenMan", "Mutate", 2, "Tried 100x and failed: %s", g.getGene().c_str());
+			Hprintf("GenMan", "Mutate", 2, "Tried 100x and failed: %s", g.getGene().c_str());
 			return Geno("", -1, "", "GENOPER_OPFAIL: Mutate() tried 100x and failed");
 		}
@@ -308,5 +308,5 @@
 
 	{
-		ErrorHandler eh(ErrorHandler::StoreFirstMessage); //mute testValidity()
+		MessageHandlerToMemory eh(MessageHandlerBase::Enable | MessageHandlerToMemory::StoreFirstMessage); //mute testValidity()
 		bool canvalidate = true;
 		if (testValidity(g1v, canvalidate) > 0 && canvalidate == false)
@@ -333,5 +333,5 @@
 			if (g1n[0]) { gn = g1n; chg = chg1; }
 			else { gn = g2n; chg = chg2; }
-			ErrorHandler eh(ErrorHandler::StoreFirstMessage); //mute testValidity()
+			MessageHandlerToMemory eh(MessageHandlerBase::Enable | MessageHandlerToMemory::StoreFirstMessage); //mute testValidity()
 			Geno G(gn, g1v.getFormat(), "", "");
 			bool canvalidate = true;
@@ -351,5 +351,5 @@
 		if (!ok && (count - pcount > 100))
 		{
-			FMprintf("GenMan", "CrossOver", 2, "Tried 100x and failed: %s and %s", g1.getGene().c_str(), g2.getGene().c_str());
+			Hprintf("GenMan", "CrossOver", 2, "Tried 100x and failed: %s and %s", g1.getGene().c_str(), g2.getGene().c_str());
 			return Geno("", -1, "", "GENOPER_OPFAIL: CrossOver() tried 100x and failed");
 		}
@@ -500,5 +500,5 @@
 	l.chg = chg;
 	l.fit = 0; //temporarily. Will be set when the genotype dies
-	//FMprintf("GenMan","saveLink",0,"#%d: [%d] '%s' + '%s' -> '%s'",GenoLinkList.size(),count,parent1.c_str(),parent2.c_str(),child.c_str());
+	//Hprintf("GenMan","saveLink",0,"#%d: [%d] '%s' + '%s' -> '%s'",GenoLinkList.size(),count,parent1.c_str(),parent2.c_str(),child.c_str());
 	GenoLinkList.push_back(l);
 }
@@ -533,5 +533,5 @@
 	float f1, f2;
 	int m;
-	FramMessage("GenMan", "Report", "The following genetic operators are available:", 0);
+	Hmessage("GenMan", "Report", "The following genetic operators are available:", 0);
 	for (unsigned int i = 0; i < oper_fx_list.size(); i++)
 	{
@@ -549,5 +549,5 @@
 		}
 		//      if (oper_fx_list[i]->similarity("","")!=GENOPER_NOOPER) l+=" similarity";
-		FMprintf("GenMan", "Report", 0, "format f%c (%s):%s",
+		Hprintf("GenMan", "Report", 0, "format f%c (%s):%s",
 			oper_fx_list[i]->supported_format, oper_fx_list[i]->name.c_str(), l.c_str());
 	}
Index: cpp/frams/genetics/geno.cpp
===================================================================
--- cpp/frams/genetics/geno.cpp	(revision 371)
+++ cpp/frams/genetics/geno.cpp	(revision 372)
@@ -250,5 +250,5 @@
 		}
 	isvalid = 0;
-	FMprintf("Geno", "validate", FMLV_WARN, "Wrong configuration? No genotype validators defined for genetic format f%c.", format);
+	Hprintf("Geno", "validate", HMLV_WARN, "Wrong configuration? No genotype validators defined for genetic format f%c.", format);
 }
 
Index: cpp/frams/genetics/oper_fx.cpp
===================================================================
--- cpp/frams/genetics/oper_fx.cpp	(revision 371)
+++ cpp/frams/genetics/oper_fx.cpp	(revision 372)
@@ -5,5 +5,5 @@
 #include <ctype.h>  //isupper()
 #include "oper_fx.h"
-#include <common/framsg.h>
+#include <common/hmessage.h>
 #include <common/nonstd_math.h>
 #include <frams/util/rndutil.h>
@@ -173,5 +173,5 @@
 		}
 		else
-			FMprintf("GenoOperators", "linearMix", FMLV_WARN, "Cannot mix values of types '%c' and '%c'", type1, type2);
+			Hprintf("GenoOperators", "linearMix", HMLV_WARN, "Cannot mix values of types '%c' and '%c'", type1, type2);
 }
 
@@ -250,5 +250,5 @@
 {
 	if (s == NULL)
-		FramMessage("GenoOperators", "skipWS", "NULL reference!", FMLV_WARN);
+		Hmessage("GenoOperators", "skipWS", "NULL reference!", HMLV_WARN);
 	else
 	while (isWS(*s)) s++;
Index: cpp/frams/mhandlers/mhandlers.cpp
===================================================================
--- cpp/frams/mhandlers/mhandlers.cpp	(revision 372)
+++ cpp/frams/mhandlers/mhandlers.cpp	(revision 372)
@@ -0,0 +1,125 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
+#include "mhandlers.h"
+#include <common/stl-util.h>
+
+void _HmessageSingleLine(const char *o, const char *m, const char *txt, int w)
+{
+	tlsGetRef(message_handler_manager_instance).send(o, m, txt, w);
+}
+
+THREAD_LOCAL_DEF(MessageHandlerManager, message_handler_manager_instance);
+
+void MessageHandlerManager::send(int level, const char *o, const char *m, const char *bl, int w)
+{
+	if (level >= handlers.size()) level = handlers.size() - 1;
+	bool blocked = 0;
+	for (int i = level; i >= 0; i--)
+	{
+		MessageHandlerBase *r = handlers(i);
+		if ((!(r->options & MessageHandlerBase::Paused)) &&
+			((!blocked) || (r->options & MessageHandlerBase::CannotBeBlocked)))
+		{
+			r->handle(o, m, bl, w);
+			if (!(r->options & MessageHandlerBase::DontBlock)) blocked = 1;
+		}
+	}
+}
+
+int MessageHandlerManager::add(MessageHandlerBase *h)
+{
+	h->mgr = this;
+	handlers += h;
+	return handlers.size() - 1;
+}
+
+void MessageHandlerManager::remove(int i)
+{
+	MessageHandlerBase *h = handlers(i);
+	h->mgr = 0;
+	handlers.remove(i);
+}
+
+void MessageHandlerManager::remove(MessageHandlerBase *h)
+{
+	int i;
+	if ((i = handlers.find(h)) < 0) return;
+	remove(i);
+}
+
+void MessageHandlerManager::removeAll()
+{
+	while (handlers.size() > 0)
+		remove(handlers.size() - 1);
+}
+
+//////////////////////////////////
+
+void MessageHandlerBase::send(const char *o, const char *m, const char *bl, int w)
+{
+	if (!isEnabled()) return;
+	int level = mgr->find(this);
+	if (level >= 0) mgr->send(level - 1, o, m, bl, w);
+}
+
+void MessageHandlerBase::Hprintf(const char *o, const char *m, int w, const char *bl, ...)
+{
+	if (!isEnabled()) return;
+	string buf;
+	va_list argptr;
+	va_start(argptr, bl);
+	buf = ssprintf_va(bl, argptr);
+	va_end(argptr);
+	send(o, m, buf.c_str(), w);
+}
+
+
+void MessageHandlerBase::enable()
+{
+	if (isEnabled()) return;
+	tlsGetRef(message_handler_manager_instance).add(this);
+}
+
+void MessageHandlerBase::disable()
+{
+	if (!isEnabled()) return;
+	tlsGetRef(message_handler_manager_instance).remove(this);
+}
+
+void MessageHandlerBase::pause()
+{
+	if (isPaused()) return;
+	options |= Paused;
+}
+
+void MessageHandlerBase::resume()
+{
+	if (!isPaused()) return;
+	options &= ~Paused;
+}
+
+/////////////////////////////////
+
+void MessageHandlerToMemory::handle(const char *o, const char *m, const char *bl, int w)
+{
+	if (w > maxlevel) maxlevel = w;
+	if (w >= HMLV_INFO) infocount++;
+	if (w >= HMLV_WARN) warncount++;
+	if (w >= HMLV_ERROR) errcount++;
+
+	if (w >= storlevel)
+	{
+		storcount++;
+		if (options & (StoreFirstMessage | StoreAllMessages))
+		{
+			if (!((options&StoreFirstMessage) && (msgs.len() > 0)))
+			{
+				if (msgs.len() > 0) msgs += '\n';
+				msgs += o; msgs += "::"; msgs += m;
+				msgs += " - "; msgs += bl;
+			}
+		}
+	}
+}
Index: cpp/frams/mhandlers/mhandlers.h
===================================================================
--- cpp/frams/mhandlers/mhandlers.h	(revision 372)
+++ cpp/frams/mhandlers/mhandlers.h	(revision 372)
@@ -0,0 +1,118 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
+#ifndef _MHANDLERS_H_
+#define _MHANDLERS_H_
+
+#include <frams/util/list.h>
+#include <frams/util/sstring.h>
+#include <common/hmessage.h>
+#include <common/threads.h>
+
+class MessageHandlerBase;
+
+class MessageHandlerManager
+{
+	friend class MessageHandlerBase;
+	SListTempl<MessageHandlerBase*> handlers;
+	void send(int level, const char *o, const char *m, const char *bl, int w);
+public:
+	int find(MessageHandlerBase *r) { return handlers.find(r); }
+	int add(MessageHandlerBase *r);
+	void remove(int i);
+	void remove(MessageHandlerBase *r);
+	void removeAll();
+	void send(const char *o, const char *m, const char *bl, int w)
+	{
+		send(handlers.size() - 1, o, m, bl, w);
+	}
+	~MessageHandlerManager() { removeAll(); }
+};
+
+extern THREAD_LOCAL_DECL(MessageHandlerManager, message_handler_manager_instance);
+
+////////////////////////////////////////
+
+class MessageHandlerBase
+{
+	friend class MessageHandlerManager;
+protected:
+	MessageHandlerManager* mgr;
+	int options;
+
+public:
+
+	enum HandlerOptions
+	{
+		DontBlock = 1, CannotBeBlocked = 2, Enable = 4, Paused = 8
+	};
+
+	void Hprintf(const char *o, const char *m, int w, const char *bl, ...);
+	void send(const char *o, const char *m, const char *bl, int w);
+
+	bool isEnabled() { return mgr ? 1 : 0; }
+	void enable();
+	void disable();
+	bool isPaused() { return (options & Paused) != 0; }
+	void pause();
+	void resume();
+
+	MessageHandlerBase(int opts = 0) :mgr(0), options(opts)
+	{
+		if (options&Enable) enable();
+	}
+	virtual ~MessageHandlerBase()
+	{
+		disable();
+	}
+
+	virtual void handle(const char *o, const char *m, const char *bl, int w) {}
+};
+
+///////////////////////////////////////////
+
+class MessageHandlerToMemory : public MessageHandlerBase
+{
+protected:
+	int maxlevel, errcount, warncount, storlevel, storcount, infocount;
+	SString msgs;
+
+public:
+
+	void reset() { maxlevel = HMLV_INFO - 1; errcount = warncount = storcount = infocount = 0; msgs = 0; }
+
+	enum Options2
+	{
+		StoreFirstMessage = 16, StoreAllMessages = 32
+	};
+
+	int getErrorCount()       { return errcount; }
+	int getWarningCount()     { return warncount; }
+	int getInfoCount()        { return infocount; }
+	int getStoredCount()      { return storcount; }
+	int getErrorLevel()       { return maxlevel; }
+	const SString& getMessages() { return msgs; }
+
+	MessageHandlerToMemory(int opts = 0, int minimal_level_to_store = HMLV_ERROR) :MessageHandlerBase(opts), storlevel(minimal_level_to_store)
+	{
+		reset();
+	}
+
+	void handle(const char *o, const char *m, const char *bl, int w);
+};
+
+class RedirectingMessageHandler : public MessageHandlerBase
+{
+	MessageHandlerManager *other_mgr;
+public:
+	RedirectingMessageHandler(MessageHandlerManager *om,int opts=0)
+		:MessageHandlerBase(opts), other_mgr(om) {}
+
+	void handle(const char *o, const char *m, const char *bl, int w)
+	{
+		other_mgr->send(o, m, bl, w);
+	}
+};
+
+#endif
Index: cpp/frams/mhandlers/stderrors.cpp
===================================================================
--- cpp/frams/mhandlers/stderrors.cpp	(revision 372)
+++ cpp/frams/mhandlers/stderrors.cpp	(revision 372)
@@ -0,0 +1,34 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
+#include "stderrors.h"
+#include <frams/util/sstringutils.h>
+#include <common/hmessage.h>
+
+bool listIndexCheck(SList* list,int index,const char* msgobj,const char* msgfun)
+{
+	int size=list->size();
+if ((index<0)||(index>=size))
+	{
+	if (size>0) 
+		Hprintf(msgobj,msgfun,HMLV_ERROR,"Invalid index %d (allowed range is 0..%d)",index,size-1);
+	else
+		Hprintf(msgobj,msgfun,HMLV_ERROR,"Invalid index %d (this list is empty)",index);
+	return 0;
+	}
+return 1;
+}
+
+SString stringCheck(SString& in,const char* msgobj,const char* msgfun,const char* msg,SString (*checker)(SString& in))
+{
+if (!checker)
+	checker=trim;
+SString corrected=checker(in);
+if (corrected!=in)
+	{
+	SString msg2=SString(msg)+": \"%s\" (adjusted to \"%s\")";
+	Hprintf(msgobj,msgfun,HMLV_WARN,msg2.c_str(),in.c_str(),corrected.c_str());
+	}
+return corrected;
+}
Index: cpp/frams/mhandlers/stderrors.h
===================================================================
--- cpp/frams/mhandlers/stderrors.h	(revision 372)
+++ cpp/frams/mhandlers/stderrors.h	(revision 372)
@@ -0,0 +1,14 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
+#ifndef _STDERRORS_H_
+#define _STDERRORS_H_
+
+#include <frams/util/list.h>
+#include <frams/util/sstring.h>
+
+bool listIndexCheck(SList* list,int index,const char* msgobj,const char* msgfun);
+SString stringCheck(SString& in,const char* msgobj,const char* msgfun,const char* msg,SString (*checker)(SString& in)=0);
+
+#endif
Index: cpp/frams/mhandlers/stdouthandler.cpp
===================================================================
--- cpp/frams/mhandlers/stdouthandler.cpp	(revision 372)
+++ cpp/frams/mhandlers/stdouthandler.cpp	(revision 372)
@@ -0,0 +1,23 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
+#include "stdouthandler.h"
+#ifdef SHP
+#include <FBaseSys.h> //AppLog
+#else
+#include <stdio.h>
+#endif
+
+void MessageHandlerToStdout::handle(const char *o, const char *m, const char *bl, int w)
+{
+	if (w < -1) w = -1; else if (w>3) w = 3;
+#ifdef SHP
+	AppLog(HMSG_FORMAT "\n",HMSG_LEVEL[w+1],o,m,bl);
+#else
+	if (file)
+		file->printf(HMSG_FORMAT "\n", HMSG_LEVEL[w + 1], o, m, bl);
+	else
+		printf(HMSG_FORMAT "\n", HMSG_LEVEL[w + 1], o, m, bl);
+#endif
+}
Index: cpp/frams/mhandlers/stdouthandler.h
===================================================================
--- cpp/frams/mhandlers/stdouthandler.h	(revision 372)
+++ cpp/frams/mhandlers/stdouthandler.h	(revision 372)
@@ -0,0 +1,19 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
+#ifndef _STDOUTHANDLER_H_
+#define _STDOUTHANDLER_H_
+
+#include "mhandlers.h"
+#include <frams/virtfile/virtfile.h>
+
+class MessageHandlerToStdout : public MessageHandlerBase
+{
+	VirtFILE *file;
+public:
+	MessageHandlerToStdout(int opts = 0, VirtFILE *_file = NULL) :MessageHandlerBase(opts), file(_file) {}
+	void handle(const char *o, const char *m, const char *bl, int w);
+};
+
+#endif
Index: cpp/frams/model/geometry/geometryutils.cpp
===================================================================
--- cpp/frams/model/geometry/geometryutils.cpp	(revision 371)
+++ cpp/frams/model/geometry/geometryutils.cpp	(revision 372)
@@ -82,5 +82,5 @@
 			break;
 	}
-	FMprintf("GeometryUtils", "isPointInsidePart", FMLV_ERROR, "Part shape=%d not supported", part->shape);
+	Hprintf("GeometryUtils", "isPointInsidePart", HMLV_ERROR, "Part shape=%d not supported", part->shape);
 	return false;
 }
@@ -102,5 +102,5 @@
 			break;
 	}
-	FMprintf("GeometryUtils", "isPointStrictlyInsidePart", FMLV_ERROR, "Part shape=%d not supported", part->shape);
+	Hprintf("GeometryUtils", "isPointStrictlyInsidePart", HMLV_ERROR, "Part shape=%d not supported", part->shape);
 	return false;
 }
Index: cpp/frams/model/geometry/meshbuilder.cpp
===================================================================
--- cpp/frams/model/geometry/meshbuilder.cpp	(revision 371)
+++ cpp/frams/model/geometry/meshbuilder.cpp	(revision 372)
@@ -639,5 +639,5 @@
 
 		default:
-			FMprintf("MeshBuilder::PartSurface", "initialize", FMLV_WARN, "Part shape=%d not supported, skipping...", part->shape);
+			Hprintf("MeshBuilder::PartSurface", "initialize", HMLV_WARN, "Part shape=%d not supported, skipping...", part->shape);
 	}
 }
@@ -725,5 +725,5 @@
 
 		default:
-			FMprintf("MeshBuilder::PartApices", "initialize", FMLV_WARN, "Part shape=%d not supported, skipping...", part->shape);
+			Hprintf("MeshBuilder::PartApices", "initialize", HMLV_WARN, "Part shape=%d not supported, skipping...", part->shape);
 	}
 }
Index: cpp/frams/model/geometry/modelgeometryinfo.cpp
===================================================================
--- cpp/frams/model/geometry/modelgeometryinfo.cpp	(revision 371)
+++ cpp/frams/model/geometry/modelgeometryinfo.cpp	(revision 372)
@@ -16,5 +16,5 @@
 	if (points.size() < 1) //maybe 1 or 2 points are also not enough for findSizesAndAxesOfPointsGroup() to work...
 	{
-		FMprintf("ModelGeometryInfo", "findSizesAndAxesOfModel", FMLV_ERROR, "Empty points sample for model with %d part(s)", model.getPartCount());
+		Hprintf("ModelGeometryInfo", "findSizesAndAxesOfModel", HMLV_ERROR, "Empty points sample for model with %d part(s)", model.getPartCount());
 		sizes = Pt3D_0;
 		axes = Orient_1;
@@ -116,5 +116,5 @@
 			return externalAreaOfCylinder(model, partIndex, density);
 	}
-	FMprintf("ModelGeometryInfo", "externalAreaOfPart", FMLV_ERROR, "Part shape=%d not supported", part->shape);
+	Hprintf("ModelGeometryInfo", "externalAreaOfPart", HMLV_ERROR, "Part shape=%d not supported", part->shape);
 	return 0;
 }
Index: cpp/frams/model/model.cpp
===================================================================
--- cpp/frams/model/model.cpp	(revision 371)
+++ cpp/frams/model/model.cpp	(revision 372)
@@ -5,7 +5,7 @@
 #include <common/nonstd_math.h>
 #include "model.h"
-#include <common/framsg.h>
+#include <common/hmessage.h>
 #include <frams/util/multimap.h>
-#include <frams/errmgr/errmanager.h>
+#include <frams/mhandlers/mhandlers.h>
 
 Model::Model()
@@ -317,5 +317,5 @@
 SString line;
 MultiRange frommap;
-ErrorHandler err(ErrorHandler::DontBlock);
+MessageHandlerToMemory mh(MessageHandlerBase::Enable | MessageHandlerBase::DontBlock);
 for (;f0txt.getNextToken(pos,line,'\n');lnum++)
 	{
@@ -325,9 +325,9 @@
 		frommap.add(lastpos,pos-1);
 		}
-	err.reset();
+	mh.reset();
 	if (singleStepBuild(line,autobuildmaps ? (&frommap) : 0)==-1)
 		{
 		buildstatus=invalid;
-		FMprintf("Model","build",FMLV_ERROR,
+		Hprintf("Model","build",HMLV_ERROR,
 			 geno.getName().len()?"illegal f0 code at line %d (%s)":"illegal f0 code at line %d",
 			 lnum,geno.getName().c_str());
@@ -336,9 +336,9 @@
 		return;
 		}
-	if (err.getWarningCount())
+	if (mh.getWarningCount())
 		{if (f0warnposition<0) f0warnposition=lastpos;}
 	lastpos=pos;
 	}
-err.disable();
+mh.disable();
 close();
 if (convmap)
@@ -513,5 +513,5 @@
 {
 if (buildstatus!=building)
-	FMprintf("Model","close",FMLV_WARN,"unexpected close() - no open()");
+	Hprintf("Model","close",HMLV_WARN,"unexpected close() - no open()");
 if (internalcheck(1)>0)
 	{
@@ -609,5 +609,5 @@
 		{
 		delete j;
-		FMprintf("Model","build",FMLV_ERROR,
+		Hprintf("Model","build",HMLV_ERROR,
 			 "invalid part reference for joint #%d",getJointCount()-1);
 		return -1;
@@ -694,5 +694,5 @@
 		return 0;
 		}
-	FMprintf("Model","build",FMLV_ERROR,
+	Hprintf("Model","build",HMLV_ERROR,
 		 "invalid neuron connection #%d <- #%d",c.n1_refno,c.n2_refno);
 	return -1;
@@ -782,5 +782,5 @@
 			else
 				{
-				FMprintf("Model","internalCheck",FMLV_ERROR,
+				Hprintf("Model","internalCheck",HMLV_ERROR,
 					 "illegal N-N connection #%d (reference to #%d) (%s)",
 					 i,n->conn_refno,(const char*)geno.getName());
@@ -853,8 +853,8 @@
 if (var -> field < getMin ## template () . field) \
 	{ var->field= getMin ## template () . field; \
-	FMprintf("Model","internalCheck",FMLV_WARN,# field " too small in " # template "#%d (adjusted)",i);} \
+	Hprintf("Model","internalCheck",HMLV_WARN,# field " too small in " # template "#%d (adjusted)",i);} \
 else if (var -> field > getMax ## template () . field) \
 	{ var->field= getMax ## template ()  . field; \
-	FMprintf("Model","internalCheck",FMLV_WARN,# field " too big in " # template "#%d (adjusted)",i);}
+	Hprintf("Model","internalCheck",HMLV_WARN,# field " too big in " # template "#%d (adjusted)",i);}
 
 #define LINKFLAG 0x8000000
@@ -912,5 +912,5 @@
 			{
 			shape=SHAPE_ILLEGAL;
-			FMprintf("Model","internalCheck",FMLV_WARN,"Inconsistent part shapes (mixed old and new shapes)");
+			Hprintf("Model","internalCheck",HMLV_WARN,"Inconsistent part shapes (mixed old and new shapes)");
 			}
 		}
@@ -941,5 +941,5 @@
 				{
 				ret=0;
-				FMprintf("Model","internalCheck",FMLV_ERROR,
+				Hprintf("Model","internalCheck",HMLV_ERROR,
 					 "delta joint cycle detected at joint#%d (%s)",
 					 i,geno.getName().c_str());
@@ -978,5 +978,5 @@
 			{
 			ret=0;
-			FMprintf("Model","internalCheck",FMLV_ERROR,"delta too big in joint #%d (%s)",
+			Hprintf("Model","internalCheck",HMLV_ERROR,"delta too big in joint #%d (%s)",
 				 i,geno.getName().c_str());
 			}
@@ -984,5 +984,5 @@
 			{
 			ret=0;
-			FMprintf("Model","internalCheck",FMLV_ERROR,"delta too small in joint #%d (%s)",
+			Hprintf("Model","internalCheck",HMLV_ERROR,"delta too small in joint #%d (%s)",
 				 i,geno.getName().c_str());
 			}
@@ -992,5 +992,5 @@
 	else
 		{
-		FMprintf("Model","internalCheck",FMLV_ERROR,"illegal part references in joint #%d (%s)",
+		Hprintf("Model","internalCheck",HMLV_ERROR,"illegal part references in joint #%d (%s)",
 			 i,geno.getName().c_str());
 		ret=0;
@@ -1001,5 +1001,5 @@
 			{
 			shape=SHAPE_ILLEGAL;
-			FMprintf("Model","internalCheck",FMLV_WARN,"Inconsistent joint shapes (mixed old and new shapes)");
+			Hprintf("Model","internalCheck",HMLV_WARN,"Inconsistent joint shapes (mixed old and new shapes)");
 			}
 		}
@@ -1071,5 +1071,5 @@
 		if (!(p->flags&LINKFLAG))
 			{
-			FMprintf("Model","internalCheck",FMLV_ERROR,"not all parts connected (eg.#0-#%d) (%s)",
+			Hprintf("Model","internalCheck",HMLV_ERROR,"not all parts connected (eg.#0-#%d) (%s)",
 				 i,geno.getName().c_str());
 			ret=0;
@@ -1084,5 +1084,5 @@
 	if (j->p1_refno==j->p2_refno)
 		{
-		FMprintf("Model","internalCheck",FMLV_ERROR,"illegal self connection, joint #%d (%s)",
+		Hprintf("Model","internalCheck",HMLV_ERROR,"illegal self connection, joint #%d (%s)",
 			 i,geno.getName().c_str());
 		ret=0;
@@ -1095,5 +1095,5 @@
 		    || ((j->p1_refno==j2->p2_refno)&&(j->p2_refno==j2->p1_refno)))
 			{
-			FMprintf("Model","internalCheck",FMLV_ERROR,"illegal duplicate joints #%d and #%d (%s)",
+			Hprintf("Model","internalCheck",HMLV_ERROR,"illegal duplicate joints #%d and #%d (%s)",
 				 i,k,geno.getName().c_str());
 			ret=0;
@@ -1125,5 +1125,5 @@
 {
 if (buildstatus==building)
-	FMprintf("Model","getGeno",FMLV_WARN,"model was not completed - missing close()");
+	Hprintf("Model","getGeno",HMLV_WARN,"model was not completed - missing close()");
 if (buildstatus!=valid)
 	return Geno("",'0',"","invalid");
Index: cpp/frams/neuro/neurofactory.cpp
===================================================================
--- cpp/frams/neuro/neurofactory.cpp	(revision 371)
+++ cpp/frams/neuro/neurofactory.cpp	(revision 372)
@@ -98,5 +98,5 @@
 	}
 if (removed.len())
-	FMprintf("NeuroFactory","removeUninmplemented",FMLV_INFO,
+	Hprintf("NeuroFactory","removeUninmplemented",HMLV_INFO,
 	 "Removed Neuro classes: %s",removed.c_str());
 }
Index: cpp/frams/neuro/neuroimpl.cpp
===================================================================
--- cpp/frams/neuro/neuroimpl.cpp	(revision 371)
+++ cpp/frams/neuro/neuroimpl.cpp	(revision 372)
@@ -72,5 +72,5 @@
 	n->userdata[mytags_id]=ni;
 	if (!ni) { errorcount++;
-		FMprintf("NeuroNetImpl","create",FMLV_WARN,"neuron #%d (%s) implementation not available",
+		Hprintf("NeuroNetImpl","create",HMLV_WARN,"neuron #%d (%s) implementation not available",
 			 i,n->getClassName().c_str());
 		continue; } // implementation not available?!
@@ -87,5 +87,5 @@
 	if (!ni->lateinit())
 		{ ni->status=NeuroImpl::InitError; errorcount++;
-		FMprintf("NeuroNetImpl","create",FMLV_WARN,"neuron #%d (%s) initialization failed",
+		Hprintf("NeuroNetImpl","create",HMLV_WARN,"neuron #%d (%s) initialization failed",
 			 i,n->getClassName().c_str());
 		continue; }
Index: cpp/frams/neuro/neuroimpl.h
===================================================================
--- cpp/frams/neuro/neuroimpl.h	(revision 371)
+++ cpp/frams/neuro/neuroimpl.h	(revision 372)
@@ -8,5 +8,5 @@
 #include <frams/model/model.h>
 #include <frams/param/param.h>
-#include <common/framsg.h>
+#include <common/hmessage.h>
 #ifdef NEURO_SIGNALS
 #include <frams/simul/signals.h>
Index: cpp/frams/param/multiparamload.cpp
===================================================================
--- cpp/frams/param/multiparamload.cpp	(revision 371)
+++ cpp/frams/param/multiparamload.cpp	(revision 372)
@@ -5,5 +5,5 @@
 #include "multiparamload.h"
 #include <frams/util/sstringutils.h>
-#include "common/framsg.h"
+#include "common/hmessage.h"
 #include <ctype.h>
 
@@ -107,5 +107,5 @@
 	else if (status==BeforeUnknown)
 		{
-		FMprintf("MultiParamLoader","go",FMLV_WARN,"Skipping object '%s'",lastunknown.c_str());
+		Hprintf("MultiParamLoader","go",HMLV_WARN,"Skipping object '%s'",lastunknown.c_str());
 		loadObjectNow(&emptyparam,false);
 		continue;
@@ -137,5 +137,5 @@
 				{
 				const char* thisfilename=file->VgetPath();
-				FMprintf("MultiParamLoader","go",FMLV_WARN,"invalid \"%s\"%s%s",buf.c_str(),
+				Hprintf("MultiParamLoader","go",HMLV_WARN,"invalid \"%s\"%s%s",buf.c_str(),
 					 (thisfilename?" in ":""),(thisfilename?thisfilename:""));
 				}
@@ -204,5 +204,5 @@
 if (alreadyIncluded(newfilename.c_str()))
 	{
-	FMprintf("MultiParamLoader","include",FMLV_WARN,"circular reference ignored (\"%s\")",
+	Hprintf("MultiParamLoader","include",HMLV_WARN,"circular reference ignored (\"%s\")",
 		    filename.c_str());
 	return;
@@ -212,5 +212,5 @@
 if (!f)
 	{
-	FMprintf("MultiParamLoader","include",FMLV_WARN,"\"%s\" not found",newfilename.c_str());
+	Hprintf("MultiParamLoader","include",HMLV_WARN,"\"%s\" not found",newfilename.c_str());
 	}
 else
Index: cpp/frams/param/param.cpp
===================================================================
--- cpp/frams/param/param.cpp	(revision 371)
+++ cpp/frams/param/param.cpp	(revision 372)
@@ -8,5 +8,5 @@
 #include "param.h"
 #include <frams/util/extvalue.h>
-#include "common/framsg.h"
+#include "common/hmessage.h"
 #include <frams/util/sstringutils.h>
 
@@ -445,5 +445,5 @@
 		{
 			SString name(p0, p_len);
-			FMprintf("ParamInterface", "load", FMLV_WARN, "Ignored unknown property '%s' while reading object '%s'", name.c_str(), getName());
+			Hprintf("ParamInterface", "load", HMLV_WARN, "Ignored unknown property '%s' while reading object '%s'", name.c_str(), getName());
 		}
 
@@ -518,5 +518,5 @@
 	case 'o':	ret.setObject(getObject(i)); break;
 	case 'x':	ret = getExtValue(i); break;
-	default: FMprintf("ParamInterface", "get", FMLV_ERROR, "'%s.%s' is not a field", getName(), id(i));
+	default: Hprintf("ParamInterface", "get", HMLV_ERROR, "'%s.%s' is not a field", getName(), id(i));
 	}
 }
@@ -562,5 +562,5 @@
 			if (v.type == TObj)
 			{
-				FMprintf("ParamInterface", "set", FMLV_WARN, "Getting integer value from object reference (%s)", v.getString().c_str());
+				Hprintf("ParamInterface", "set", HMLV_WARN, "Getting integer value from object reference (%s)", v.getString().c_str());
 				return 0;
 			}
@@ -574,5 +574,5 @@
 			if (v.type == TObj)
 			{
-				FMprintf("ParamInterface", "set", FMLV_WARN, "Getting floating point value from object reference (%s)", v.getString().c_str());
+				Hprintf("ParamInterface", "set", HMLV_WARN, "Getting floating point value from object reference (%s)", v.getString().c_str());
 				return 0;
 			}
@@ -583,5 +583,5 @@
 	case 'o': return setObject(i, v.getObject());
 	case 'x': return setExtValue(i, v);
-	default: FMprintf("ParamInterface", "set", FMLV_ERROR, "'%s.%s' is not a field", getName(), id(i));
+	default: Hprintf("ParamInterface", "set", HMLV_ERROR, "'%s.%s' is not a field", getName(), id(i));
 	}
 	return 0;
@@ -605,5 +605,5 @@
 			if ((after == NULL) || (*after))
 			{
-				FMprintf("ParamInterface", "set", FMLV_WARN, "serialization format mismatch in %s.%s", (getName() ? getName() : "<Unknown>"), id(i));
+				Hprintf("ParamInterface", "set", HMLV_WARN, "serialization format mismatch in %s.%s", (getName() ? getName() : "<Unknown>"), id(i));
 				e.setEmpty();
 			}
@@ -690,5 +690,5 @@
 	}
 	if (err!=NULL)
-		FMprintf("SimpleAbstractParam","sanityCheck", FMLV_ERROR,
+		Hprintf("SimpleAbstractParam","sanityCheck", HMLV_ERROR,
 		"Invalid ParamEntry for %s.%s (%s)", getName(), pe->id, err);
 }	
@@ -961,5 +961,5 @@
 	else
 	{
-		FMprintf("SimpleAbstractParam", "call", FMLV_ERROR,
+		Hprintf("SimpleAbstractParam", "call", HMLV_ERROR,
 			(*pe->type != 'p') ? "'%s.%s' is not a function" : "Internal error - undefined function pointer for '%s.%s'", getName(), pe->id);
 		ret->setInvalid();
@@ -1060,5 +1060,5 @@
 			{
 				SString name(t, (int)(equals_sign - t));
-				FMprintf("Param", "load2", FMLV_WARN, "Unknown property '%s' while reading object '%s' (ignored)", name.c_str(), getName());
+				Hprintf("Param", "load2", HMLV_WARN, "Unknown property '%s' while reading object '%s' (ignored)", name.c_str(), getName());
 			}
 			t = equals_sign + 1; // t=value
@@ -1070,5 +1070,5 @@
 #endif
 			{
-			FMprintf("Param", "load2", FMLV_WARN, "Missing property name in '%s' (assuming '%s')",
+			Hprintf("Param", "load2", HMLV_WARN, "Missing property name in '%s' (assuming '%s')",
 				getName(), id(i) ? id(i) : "unknown property?");
 			}
@@ -1092,5 +1092,5 @@
 			fields_loaded++;
 			if (ret&(PSET_HITMAX | PSET_HITMIN))
-				FMprintf("Param", "load2", FMLV_WARN, "Adjusted '%s' in '%s' (was too %s)",
+				Hprintf("Param", "load2", HMLV_WARN, "Adjusted '%s' in '%s' (was too %s)",
 				id(i), getName(), (ret&PSET_HITMAX) ? "big" : "small");
 			*(char*)valstop = remember;
Index: cpp/frams/param/param.h
===================================================================
--- cpp/frams/param/param.h	(revision 371)
+++ cpp/frams/param/param.h	(revision 372)
@@ -12,5 +12,5 @@
 #include <frams/util/statrick.h>
 #include <frams/virtfile/virtfile.h>
-#include <common/framsg.h>
+#include <common/hmessage.h>
 
 class ExtValue;
@@ -273,5 +273,5 @@
 			SString svaluetoset = SString::valueOf(valuetoset); //converts any type to SString
 			SString actual = get(i);
-			FMprintf("Param", "set", FMLV_WARN, "Setting '%s.%s = %s' exceeded allowed range (too %s). Adjusted to %s.",
+			Hprintf("Param", "set", HMLV_WARN, "Setting '%s.%s = %s' exceeded allowed range (too %s). Adjusted to %s.",
 				getName(), id(i), svaluetoset.c_str(), (setflags&PSET_HITMAX) ? "big" : "small", actual.c_str());
 		}
Index: cpp/frams/util/3d.cpp
===================================================================
--- cpp/frams/util/3d.cpp	(revision 371)
+++ cpp/frams/util/3d.cpp	(revision 372)
@@ -4,5 +4,5 @@
 
 #include <common/nonstd_math.h>
-#include <common/framsg.h>
+#include <common/hmessage.h>
 #include "3d.h"
 
@@ -17,5 +17,5 @@
 {
 	double q = x*x + y*y + z*z;
-	if (q < 0) { if (report_errors) FMprintf("Pt3D", "operator()", FMLV_ERROR, "sqrt(%g): domain error", q); return 0; }
+	if (q < 0) { if (report_errors) Hprintf("Pt3D", "operator()", HMLV_ERROR, "sqrt(%g): domain error", q); return 0; }
 	return sqrt(q);
 }
@@ -24,5 +24,5 @@
 {
 	double len = length();
-	if (fabs(len) < 1e-50) { if (report_errors) FMprintf("Pt3D", "normalize()", FMLV_WARN, "vector[%g,%g,%g] too small", x, y, z); x = 1; y = 0; z = 0; return false; }
+	if (fabs(len) < 1e-50) { if (report_errors) Hprintf("Pt3D", "normalize()", HMLV_WARN, "vector[%g,%g,%g] too small", x, y, z); x = 1; y = 0; z = 0; return false; }
 	operator/=(len);
 	return true;
@@ -64,5 +64,5 @@
 	if (dx == 0 && dy == 0)
 	{
-		if (report_errors) FMprintf("Pt3D", "getAngle()", FMLV_WARN, "atan2(%g,%g)", dy, dx);
+		if (report_errors) Hprintf("Pt3D", "getAngle()", HMLV_WARN, "atan2(%g,%g)", dy, dx);
 		return 0; // incorrect result, but there is no correct one
 	}
@@ -147,5 +147,5 @@
 {
 	double q = x*x + y*y;
-	if (q < 0) { if (Pt3D::report_errors) FMprintf("", "d2()", FMLV_ERROR, "sqrt(%g): domain error", q); return 0; }
+	if (q < 0) { if (Pt3D::report_errors) Hprintf("", "d2()", HMLV_ERROR, "sqrt(%g): domain error", q); return 0; }
 	return sqrt(q);
 }
Index: cpp/frams/util/extvalue.cpp
===================================================================
--- cpp/frams/util/extvalue.cpp	(revision 371)
+++ cpp/frams/util/extvalue.cpp	(revision 372)
@@ -98,5 +98,5 @@
 	if (warn)
 	{
-		FMprintf("ExtValue", "getObjectTarget", FMLV_WARN, "%s object expected, %s found", classname, interfaceName());
+		Hprintf("ExtValue", "getObjectTarget", HMLV_WARN, "%s object expected, %s found", classname, interfaceName());
 	}
 
@@ -269,5 +269,5 @@
 			if (tmp.len() > 30) tmp = tmp.substr(0, 30) + "...";
 			if (type == TString) tmp = SString("\"") + tmp + SString("\"");
-			FMprintf("ExtValue", "getObjectTarget", FMLV_WARN, "%s object expected, %s found", classname, tmp.c_str());
+			Hprintf("ExtValue", "getObjectTarget", HMLV_WARN, "%s object expected, %s found", classname, tmp.c_str());
 		}
 		return NULL;
@@ -419,5 +419,5 @@
 				context->v2->typeAndValue().c_str());
 		}
-		FMprintf("ExtValue", "interpretCompare", FMLV_ERROR, "%s", msg.c_str());
+		Hprintf("ExtValue", "interpretCompare", HMLV_ERROR, "%s", msg.c_str());
 		ret = -1;
 	}
@@ -448,5 +448,5 @@
 		{
 		case TDouble:
-			FMprintf("ExtValue", "add", FMLV_WARN, "Adding %s to %s", src.typeAndValue().c_str(), typeAndValue().c_str());
+			Hprintf("ExtValue", "add", HMLV_WARN, "Adding %s to %s", src.typeAndValue().c_str(), typeAndValue().c_str());
 			setDouble(double(getInt()) + src.getDouble());
 			return;
@@ -487,5 +487,5 @@
 	default:;
 	}
-	FMprintf("ExtValue", "add", FMLV_ERROR, "Can't add %s to %s", src.typeAndValue().c_str(), typeAndValue().c_str());
+	Hprintf("ExtValue", "add", HMLV_ERROR, "Can't add %s to %s", src.typeAndValue().c_str(), typeAndValue().c_str());
 }
 
@@ -502,5 +502,5 @@
 			return;
 		case TDouble:
-			FMprintf("ExtValue", "subtract", FMLV_WARN, "Subtracting %s from %s", src.typeAndValue().c_str(), typeAndValue().c_str());
+			Hprintf("ExtValue", "subtract", HMLV_WARN, "Subtracting %s from %s", src.typeAndValue().c_str(), typeAndValue().c_str());
 			setDouble(double(getInt()) - src.getDouble());
 			return;
@@ -520,5 +520,5 @@
 	default:;
 	}
-	FMprintf("ExtValue", "subtract", FMLV_ERROR, "Can't subtract %s from %s", src.typeAndValue().c_str(), typeAndValue().c_str());
+	Hprintf("ExtValue", "subtract", HMLV_ERROR, "Can't subtract %s from %s", src.typeAndValue().c_str(), typeAndValue().c_str());
 }
 
@@ -535,5 +535,5 @@
 			return;
 		case TDouble:
-			FMprintf("ExtValue", "multiply", FMLV_WARN, "Multiplying %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str());
+			Hprintf("ExtValue", "multiply", HMLV_WARN, "Multiplying %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str());
 			setDouble(double(getInt())*src.getDouble());
 			return;
@@ -591,8 +591,7 @@
 	default:;
 	}
-	FMprintf("ExtValue", "multiply", FMLV_WARN, "Can't multiply %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str());
-}
-
-#include <common/framsg.h>
+	Hprintf("ExtValue", "multiply", HMLV_WARN, "Can't multiply %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str());
+}
+
 /*#include "fpu_control.h"
 #include <signal.h>
@@ -612,5 +611,5 @@
 	else
 	{
-		FMprintf("ExtValue", "divide", FMLV_CRITICAL, "Division by zero: %d/0", idata());
+		Hprintf("ExtValue", "divide", HMLV_CRITICAL, "Division by zero: %d/0", idata());
 		setInvalid();
 	}
@@ -621,5 +620,5 @@
 	if (a == 0.0)
 	{
-		FMprintf("ExtValue", "divide", FMLV_CRITICAL, "Division by zero: %s/0.0", getString().c_str());
+		Hprintf("ExtValue", "divide", HMLV_CRITICAL, "Division by zero: %s/0.0", getString().c_str());
 		setInvalid();
 	}
@@ -630,5 +629,5 @@
 		if (!finite(tmp))
 		{
-			FMprintf("ExtValue", "divide", FMLV_CRITICAL, "Overflow %s/%g", getString().c_str(), a); setInvalid();
+			Hprintf("ExtValue", "divide", HMLV_CRITICAL, "Overflow %s/%g", getString().c_str(), a); setInvalid();
 		}
 		else
@@ -636,5 +635,5 @@
 		// niby dobrze ale lepiej byloby to robic bardziej systematycznie a nie tylko w dzieleniu?
 		//if (isnan(ddata())) //http://www.digitalmars.com/d/archives/c++/Traping_divide_by_zero_5728.html
-		//	  { FMprintf("ExtValue","divide",FMLV_ERROR,"not-a-number",(const char*)getString()); setInvalid(); }
+		//	  { Hprintf("ExtValue","divide",HMLV_ERROR,"not-a-number",(const char*)getString()); setInvalid(); }
 		fpExceptEnable();
 	}
@@ -652,5 +651,5 @@
 			return;
 		case TDouble:
-			FMprintf("ExtValue", "divide", FMLV_WARN, "Dividing %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str());
+			Hprintf("ExtValue", "divide", HMLV_WARN, "Dividing %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str());
 			divDouble(src.ddata());
 			return;
@@ -674,5 +673,5 @@
 	default:;
 	}
-	FMprintf("ExtValue", "divide", FMLV_ERROR, "Can't divide %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str());
+	Hprintf("ExtValue", "divide", HMLV_ERROR, "Can't divide %s by %s", typeAndValue().c_str(), src.typeAndValue().c_str());
 }
 
@@ -779,5 +778,5 @@
 
 	case TObj: case TUnknown: case TInvalid:
-		FMprintf("ExtValue", "modulo", FMLV_WARN, "Can't apply modulo to %s", typeDescription().c_str());
+		Hprintf("ExtValue", "modulo", HMLV_WARN, "Can't apply modulo to %s", typeDescription().c_str());
 
 	default:;
@@ -792,5 +791,5 @@
 	{
 		if (error)
-			FMprintf("ExtValue", "parseInt", FMLV_ERROR, "Could not parse '%s'%s", s, strict ? " (strict)" : "");
+			Hprintf("ExtValue", "parseInt", HMLV_ERROR, "Could not parse '%s'%s", s, strict ? " (strict)" : "");
 		return false;
 	}
@@ -806,5 +805,5 @@
 	{
 		if (error)
-			FMprintf("ExtValue", "parseDouble", FMLV_ERROR, "Could not parse '%s'", s);
+			Hprintf("ExtValue", "parseDouble", HMLV_ERROR, "Could not parse '%s'", s);
 		return false;
 	}
@@ -837,5 +836,5 @@
 	case TString: return getInt(sdata().c_str());
 	case TObj:
-		FMprintf("ExtValue", "getInt", FMLV_WARN, "Getting integer value from object reference (%s)", getString().c_str());
+		Hprintf("ExtValue", "getInt", HMLV_WARN, "Getting integer value from object reference (%s)", getString().c_str());
 		return (paInt)(intptr_t)odata().param;
 	default:;
@@ -852,5 +851,5 @@
 	case TString: return getDouble(sdata().c_str());
 	case TObj:
-		FMprintf("ExtValue", "getDouble", FMLV_WARN, "Getting floating point value from object reference (%s)", getString().c_str());
+		Hprintf("ExtValue", "getDouble", HMLV_WARN, "Getting floating point value from object reference (%s)", getString().c_str());
 		return (double)(intptr_t)odata().param;
 	default:;
@@ -990,5 +989,5 @@
 		else
 		{
-			FMprintf("ExtValue", "deserialize", FMLV_ERROR, "Missing '\"' in string: '%s'", ret);
+			Hprintf("ExtValue", "deserialize", HMLV_ERROR, "Missing '\"' in string: '%s'", ret);
 			return NULL;
 		}
@@ -1012,5 +1011,5 @@
 				else if (*p != ']')
 				{
-					FMprintf("ExtValue", "deserialize", FMLV_ERROR, "Missing ',' in Vector: '%s'", p);
+					Hprintf("ExtValue", "deserialize", HMLV_ERROR, "Missing ',' in Vector: '%s'", p);
 					return NULL;
 				}
@@ -1038,5 +1037,5 @@
 			if ((!ret) || (args[1].getType() != TString)) { p = NULL; break; }
 			p = ret;
-			if (*p != ':') { FMprintf("ExtValue", "deserialize", FMLV_ERROR, "Missing ':' in Dictionary: '%s'", p); p = NULL; break; }
+			if (*p != ':') { Hprintf("ExtValue", "deserialize", HMLV_ERROR, "Missing ':' in Dictionary: '%s'", p); p = NULL; break; }
 			p++;
 			ret = args[0].deserialize(p);
@@ -1047,5 +1046,5 @@
 			else if (*p != '}')
 			{
-				FMprintf("ExtValue", "deserialize", FMLV_ERROR, "Missing ',' in Dictionary: '%s'", p);
+				Hprintf("ExtValue", "deserialize", HMLV_ERROR, "Missing ',' in Dictionary: '%s'", p);
 				return NULL;
 			}
@@ -1087,5 +1086,5 @@
 			}
 		}
-		FMprintf("ExtValue", "deserialize", FMLV_ERROR, "Invalid reference: '%s'", in - 1);
+		Hprintf("ExtValue", "deserialize", HMLV_ERROR, "Invalid reference: '%s'", in - 1);
 		return NULL;
 	}
@@ -1134,8 +1133,8 @@
 		}
 		setEmpty();
-		FMprintf("ExtValue", "deserialize", FMLV_WARN, "object of class \"%s\" could not be deserialized", clsname.c_str());
+		Hprintf("ExtValue", "deserialize", HMLV_WARN, "object of class \"%s\" could not be deserialized", clsname.c_str());
 		return ret;
 	}
-	FMprintf("ExtValue", "deserialize", FMLV_ERROR, "Bad syntax: '%s'", in);
+	Hprintf("ExtValue", "deserialize", HMLV_ERROR, "Bad syntax: '%s'", in);
 	setEmpty();
 	return NULL;
Index: cpp/frams/util/sstringutils.cpp
===================================================================
--- cpp/frams/util/sstringutils.cpp	(revision 371)
+++ cpp/frams/util/sstringutils.cpp	(revision 372)
@@ -5,5 +5,5 @@
 #include "sstringutils.h"
 #include <frams/virtfile/virtfile.h>
-#include <common/framsg.h>
+#include <common/hmessage.h>
 #include <common/nonstd.h>
 
@@ -19,5 +19,5 @@
 	}
 	else if (framsgmodule)
-		FMprintf(framsgmodule, "loadSString", FMLV_WARN, error ? error : "can't open file \"%s\"", filename);
+		Hprintf(framsgmodule, "loadSString", HMLV_WARN, error ? error : "can't open file \"%s\"", filename);
 	return ret;
 }
Index: cpp/frams/virtfile/stdiofile.cpp
===================================================================
--- cpp/frams/virtfile/stdiofile.cpp	(revision 371)
+++ cpp/frams/virtfile/stdiofile.cpp	(revision 372)
@@ -6,10 +6,10 @@
 #include <common/nonstd_dir.h>
 #include <common/nonstd_stdio.h>
-#include <common/framsg.h>
+#include <common/hmessage.h>
 #include <common/Convert.h>
 
 VirtFILE* StdioFileSystem::Vfopen(const char *path, const char *mode)
 {
-	//printFM("Vfopen %s %s",path,mode);
+	//printH("Vfopen %s %s",path,mode);
 #ifdef _WIN32
 	FILE *f = _wfopen(Convert::utf8ToUtf16(path).c_str(), Convert::strTOwstr(mode).c_str());
@@ -21,5 +21,5 @@
 #endif
 #endif
-	//printFM("%p",f);
+	//printH("%p",f);
 	if (f) return new StdioFILE(f, path); else return NULL;
 }
@@ -27,5 +27,5 @@
 VirtDIR* StdioFileSystem::Vopendir(const char* path)
 {
-	//printFM("Vopendir %s",path);
+	//printH("Vopendir %s",path);
 #ifdef _WIN32
 	DIRTYPE *d = wopendir(Convert::utf8ToUtf16(path).c_str());
@@ -33,5 +33,5 @@
 	DIR *d = opendir(path);
 #endif
-	//printFM("%p",d);
+	//printH("%p",d);
 	if (d) return new StdioDIR(d); else return NULL;
 }
@@ -56,5 +56,5 @@
 dirent* StdioDIR::Vreaddir()
 {
-	//printFM("Vreaddir %s",dir);
+	//printH("Vreaddir %s",dir);
 #ifdef _WIN32
 	wdirent *wde=wreaddir(dir);
Index: cpp/frams/vm/classes/collectionobj.cpp
===================================================================
--- cpp/frams/vm/classes/collectionobj.cpp	(revision 371)
+++ cpp/frams/vm/classes/collectionobj.cpp	(revision 372)
@@ -5,5 +5,5 @@
 #include "collectionobj.h"
 #include <common/nonstd_math.h> //sqrt in borland
-#include <frams/errmgr/stderrors.h>
+#include <frams/mhandlers/stderrors.h>
 #include <common/nonstd_stl.h>
 #include <frams/util/sstringutils.h>
@@ -232,5 +232,5 @@
 	{
 	ret=false;
-	FMprintf("VectorElementComparator","",FMLV_ERROR,"Comparison function returned no value");
+	Hprintf("VectorElementComparator","",HMLV_ERROR,"Comparison function returned no value");
 	}
 else
