Index: trunk/src/cppbase/bs_config.cpp
===================================================================
--- trunk/src/cppbase/bs_config.cpp	(revision 341)
+++ trunk/src/cppbase/bs_config.cpp	(revision 343)
@@ -69,5 +69,5 @@
 
 /*
- *      This file Copyright (C) 1999-2001 Ulrich Mller.
+ *      This file Copyright (C) 1999-2006 Ulrich Mller.
  *      This program is free software; you can redistribute it and/or modify
  *      it under the terms of the GNU General Public License as published by
@@ -1426,4 +1426,5 @@
  *
  +          CREATEOBJECT="[REPLACE] classname|title|location[|config]]"
+ +          CREATEOBJECT="[FAIL] classname|title|location[|config]]"
  *
  *      Throws:
@@ -1433,4 +1434,5 @@
  *@@changed V0.9.15 (2001-08-26) [umoeller]: added WPOEXCPT_INVALIDLOCATION checks
  *@@changed V0.9.19 (2002-04-14) [umoeller]: REPLACE was never detected, fixed
+ *@@changed V1.0.14 (2006-12-03) [pr]: added FAIL mode @@fixes 893
  */
 
@@ -1445,15 +1447,21 @@
         throw BSConfigExcpt(WPOEXCPT_NOCLASS, ustrCreateObject);
 
-    // if (!strcmp(pBegin, "REPLACE "))     BUZZZZ WRONG V0.9.19 (2002-04-14) [umoeller]
     if (!memcmp(pBegin, "REPLACE ", 8))
     {
-        // added V0.9.3 (2000-04-08) [umoeller]
-        _fReplace = TRUE;
-        pBegin += 7;
+        _ulFlags = CO_REPLACEIFEXISTS;  // V1.0.14 (2006-12-03) [pr]
+        pBegin += 8;
         while (*pBegin == ' ')
             pBegin++;
     }
     else
-        _fReplace = FALSE;
+        if (!memcmp(pBegin, "FAIL ", 5))  // V1.0.14 (2006-12-03) [pr]
+        {
+            _ulFlags = CO_FAILIFEXISTS;
+            pBegin += 5;
+            while (*pBegin == ' ')
+                pBegin++;
+        }
+        else
+            _ulFlags = CO_UPDATEIFEXISTS;  // V1.0.14 (2006-12-03) [pr]
 
     PSZ pEnd;
@@ -1544,4 +1552,5 @@
  *
  *@@changed V0.9.18 (2002-03-08) [umoeller]: added codec
+ *@@changed V1.0.14 (2006-12-03) [pr]: added FAIL mode @@fixes 893
  */
 
@@ -1575,30 +1584,42 @@
                                   pcszSetupString,
                                   pcszLocation,
-                                  (_fReplace)
-                                     ? CO_REPLACEIFEXISTS
-                                     : CO_UPDATEIFEXISTS)))
-    {
+                                  _ulFlags)))
+    {
+        if (_ulFlags == CO_FAILIFEXISTS)  // V1.0.14 (2006-12-03) [pr]
+        {
+            if (pLogFile)
+                pLogFile->Write("WPS object already exists \"%s\", class \"%s\", location \"%s\", setup \"%s\"",
+                                pcszTitle,
+                                pcszClassName,
+                                pcszLocation,
+                                pcszSetupString);
+        }
+        else
+        {
+            if (pLogFile)
+                pLogFile->Write("Error creating WPS object \"%s\", class \"%s\", location \"%s\", setup \"%s\"",
+                                pcszTitle,
+                                pcszClassName,
+                                pcszLocation,
+                                pcszSetupString);
+
+            throw BSConfigExcpt(WPOEXCPT_CREATE, _ustrTitle);
+        }
+    }
+    else
+    {
+        // V1.0.5 (2005-02-17) [pr]
+        // We now save the object synchronously to prevent objects getting lost if we
+        // restart the WPS imminently due to a class registration for example. @@fixes 634.
+        WinSaveObject (_hobj, FALSE);
         if (pLogFile)
-            pLogFile->Write("Error creating WPS object \"%s\", class \"%s\", location \"%s\", setup \"%s\"",
-                             pcszTitle,
-                             pcszClassName,
-                             pcszLocation,
-                             pcszSetupString);
-
-        throw BSConfigExcpt(WPOEXCPT_CREATE, _ustrTitle);
-    }
-
-    // V1.0.5 (2005-02-17) [pr]
-    // We now save the object synchronously to prevent objects getting lost if we
-    // restart the WPS imminently due to a class registration for example. @@fixes 634.
-    WinSaveObject (_hobj, FALSE);
-    if (pLogFile)
-    {
-        pLogFile->Write("Created WPS object \"%s\", class \"%s\", location \"%s\", setup \"%s\"",
-                         pcszTitle,
-                         pcszClassName,
-                         pcszLocation,
-                         pcszSetupString);
-        pLogFile->Write("HOBJECT is 0x%lX", _hobj);
+        {
+            pLogFile->Write("Created WPS object \"%s\", class \"%s\", location \"%s\", setup \"%s\"",
+                            pcszTitle,
+                            pcszClassName,
+                            pcszLocation,
+                            pcszSetupString);
+            pLogFile->Write("HOBJECT is 0x%lX", _hobj);
+        }
     }
 
