Index: trunk/FACT++/dim/README_v19.txt
===================================================================
--- trunk/FACT++/dim/README_v19.txt	(revision 11121)
+++ trunk/FACT++/dim/README_v19.txt	(revision 11695)
@@ -1,4 +1,4 @@
 
-                    DIM version 19.22 Release Notes
+                    DIM version 19.23 Release Notes
 
 Notes 1 and 2 for Unix Users only
@@ -17,5 +17,23 @@
 		Dns </dev/null >& dns.log &
 
-NOTE 3: The Version Number service provided by servers is now set to 1922.
+NOTE 3: The Version Number service provided by servers is now set to 1923.
+
+15/07/2011
+Changes for version 19.23:
+    - The new functions:
+	int DimClient::inCallback()
+	int DimServer::inCallback()
+      Can be used to find out if the function is being called in the context of a DIM callback
+      handler (they return 1 if yes, 0 if no).
+    - There was no way to "remove" an errorHandler or exitHandler in C++.
+      Now the following functions accept 0 as parameter:
+	DimClient::addErrorHandler(0)
+	DimServer::addErrorHandler(0)
+	DimServer::addExitHandler(0)
+	DimServer::addClientExitHandler(0)
+      In order to remove them.
+    - The Windows Visual Studio Manifest file distributed since version v19r19 was wrong, so the latest
+      DIM versions did not work on Windows machines without Visual Studio 8 installed - Fixed.
+
 
 21/06/2011
Index: trunk/FACT++/dim/dim/dic.hxx
===================================================================
--- trunk/FACT++/dim/dim/dic.hxx	(revision 11121)
+++ trunk/FACT++/dim/dim/dic.hxx	(revision 11695)
@@ -462,4 +462,5 @@
 	static void setNoDataCopy();
 	static int getNoDataCopy();
+	static int inCallback();
 };
 
Index: trunk/FACT++/dim/dim/dim.h
===================================================================
--- trunk/FACT++/dim/dim/dim.h	(revision 11121)
+++ trunk/FACT++/dim/dim/dim.h	(revision 11695)
@@ -14,5 +14,5 @@
 #include "dim_common.h"
 
-#define DIM_VERSION_NUMBER 1922
+#define DIM_VERSION_NUMBER 1923
 
 #define MY_LITTLE_ENDIAN	0x1
Index: trunk/FACT++/dim/dim/dis.hxx
===================================================================
--- trunk/FACT++/dim/dim/dis.hxx	(revision 11121)
+++ trunk/FACT++/dim/dim/dis.hxx	(revision 11695)
@@ -136,4 +136,5 @@
 	virtual void serviceHandler() {};
 	virtual void commandHandler() {};
+	static int inCallback();
 };
 
Index: trunk/FACT++/dim/src/diccpp.cxx
===================================================================
--- trunk/FACT++/dim/src/diccpp.cxx	(revision 11121)
+++ trunk/FACT++/dim/src/diccpp.cxx	(revision 11695)
@@ -1111,5 +1111,6 @@
 
 	DimCore::inCallback = 2;
-	DimClient::itsCltError->errorHandler(severity, code, msg);
+	if(DimClient::itsCltError != 0)
+		DimClient::itsCltError->errorHandler(severity, code, msg);
 	DimCore::inCallback = 0;
 }
@@ -1118,6 +1119,14 @@
 void DimClient::addErrorHandler(DimErrorHandler *handler)
 {
-	DimClient::itsCltError = handler;
-	dic_add_error_handler(clt_error_user_routine);
+	if(handler == 0)
+	{
+		dic_add_error_handler(0);
+		DimClient::itsCltError = 0;
+	}
+	else
+	{
+		DimClient::itsCltError = handler;
+		dic_add_error_handler(clt_error_user_routine);
+	}
 }
 
@@ -1207,2 +1216,9 @@
 	return list;
 }
+
+int DimClient::inCallback()
+{
+	if(DimCore::inCallback)
+		return 1;
+	return 0;
+}
Index: trunk/FACT++/dim/src/discpp.cxx
===================================================================
--- trunk/FACT++/dim/src/discpp.cxx	(revision 11121)
+++ trunk/FACT++/dim/src/discpp.cxx	(revision 11695)
@@ -612,6 +612,14 @@
 void DimServer::addClientExitHandler(DimClientExitHandler *handler)
 {
-	DimServer::itsClientExit = handler;
-	dis_add_client_exit_handler(client_exit_user_routine);
+	if(handler == 0)
+	{
+		dis_add_client_exit_handler(0);
+		DimServer::itsClientExit = 0;
+	}
+	else
+	{
+		DimServer::itsClientExit = handler;
+		dis_add_client_exit_handler(client_exit_user_routine);
+	}
 }
 
@@ -624,12 +632,28 @@
 void DimServer::addExitHandler(DimExitHandler *handler)
 {
-	DimServer::itsExit = handler;
-	dis_add_exit_handler(exit_user_routine);
+	if(handler == 0)
+	{
+		dis_add_exit_handler(0);
+		DimServer::itsExit = 0;
+	}
+	else
+	{
+		DimServer::itsExit = handler;
+		dis_add_exit_handler(exit_user_routine);
+	}
 }
 
 void DimServer::addErrorHandler(DimErrorHandler *handler)
 {
-	DimServer::itsSrvError = handler;
-	dis_add_error_handler(srv_error_user_routine);
+	if(handler == 0)
+	{
+		dis_add_error_handler(0);
+		DimServer::itsSrvError = 0;
+	}
+	else
+	{
+		DimServer::itsSrvError = handler;
+		dis_add_error_handler(srv_error_user_routine);
+	}
 }
 
@@ -686,4 +710,11 @@
 }
 
+int DimServer::inCallback()
+{
+	if(DimCore::inCallback)
+		return 1;
+	return 0;
+}
+
 extern "C" {
 static void client_exit_user_routine(int *idp)
@@ -711,5 +742,6 @@
 
 	DimCore::inCallback = 2;
-	DimServer::itsSrvError->errorHandler(severity, code, msg);
+	if(DimServer::itsSrvError != 0)
+		DimServer::itsSrvError->errorHandler(severity, code, msg);
 	DimCore::inCallback = 0;
 }
Index: trunk/FACT++/dim/src/examples/test_client.cxx
===================================================================
--- trunk/FACT++/dim/src/examples/test_client.cxx	(revision 11121)
+++ trunk/FACT++/dim/src/examples/test_client.cxx	(revision 11695)
@@ -39,4 +39,6 @@
 			index++;
 		}
+		int inCallback = DimClient::inCallback();
+		cout << "infoHandler: In callback "<< inCallback << endl; 
 	}
 public :
@@ -83,4 +85,8 @@
 		cout << "Current INTVAL : " << servint.getInt() << endl;
 		DimClient::sendCommand("TEST/CMND","UPDATE_STRVAL");
+		int inCallback = DimClient::inCallback();
+		cout << "main: In callback "<< inCallback << endl;
+
+		DimClient::addErrorHandler(0);
 	}
 	return 0;
Index: trunk/FACT++/dim/src/examples/test_server.cxx
===================================================================
--- trunk/FACT++/dim/src/examples/test_server.cxx	(revision 11121)
+++ trunk/FACT++/dim/src/examples/test_server.cxx	(revision 11695)
@@ -183,8 +183,8 @@
 	}
 */
-
 	while(1)
 	{
 		sleep(5);
+
 /*
 		while(cmdsvr.hasNext())
@@ -200,4 +200,7 @@
 			boolval = 0;
 		ival++;
+		
+		int inCallback = DimServer::inCallback();
+		cout << "main: In callback "<< inCallback << endl; 
 		servint.updateService();
 		if(extraDns)
