Index: /trunk/include/VBox/com/defs.h
===================================================================
--- /trunk/include/VBox/com/defs.h	(revision 60765)
+++ /trunk/include/VBox/com/defs.h	(revision 60766)
@@ -279,50 +279,4 @@
 
 #include <nsID.h>
-
-#ifndef VBOX_COM_NO_ATL
-
-namespace ATL
-{
-
-#define ATL_NO_VTABLE
-#define DECLARE_CLASSFACTORY(a)
-#define DECLARE_CLASSFACTORY_SINGLETON(a)
-#define DECLARE_REGISTRY_RESOURCEID(a)
-#define DECLARE_NOT_AGGREGATABLE(a)
-#define DECLARE_PROTECT_FINAL_CONSTRUCT()
-#define BEGIN_COM_MAP(a)
-#define COM_INTERFACE_ENTRY(a)
-#define COM_INTERFACE_ENTRY2(a,b)
-#define END_COM_MAP() NS_DECL_ISUPPORTS
-#define COM_INTERFACE_ENTRY_AGGREGATE(a,b)
-
-/* A few very simple ATL emulator classes to provide
- * FinalConstruct()/FinalRelease() functionality with XPCOM. */
-
-class CComMultiThreadModel
-{
-};
-
-template <class DummyThreadModel> class CComObjectRootEx
-{
-public:
-    HRESULT FinalConstruct()
-    {
-        return S_OK;
-    }
-    void FinalRelease()
-    {
-    }
-};
-
-template <class DummyThreadModel> class CComObject
-{
-public:
-    virtual ~CComObject() { this->FinalRelease(); }
-};
-
-} /* namespace ATL */
-
-#endif /* !VBOX_COM_NO_ATL */
 
 #define HRESULT     nsresult
@@ -442,4 +396,47 @@
 #ifndef VBOX_COM_NO_ATL
 
+namespace ATL
+{
+
+#define ATL_NO_VTABLE
+#define DECLARE_CLASSFACTORY(a)
+#define DECLARE_CLASSFACTORY_SINGLETON(a)
+#define DECLARE_REGISTRY_RESOURCEID(a)
+#define DECLARE_NOT_AGGREGATABLE(a)
+#define DECLARE_PROTECT_FINAL_CONSTRUCT()
+#define BEGIN_COM_MAP(a)
+#define COM_INTERFACE_ENTRY(a)
+#define COM_INTERFACE_ENTRY2(a,b)
+#define END_COM_MAP() NS_DECL_ISUPPORTS
+#define COM_INTERFACE_ENTRY_AGGREGATE(a,b)
+
+/* A few very simple ATL emulator classes to provide
+ * FinalConstruct()/FinalRelease() functionality with XPCOM. */
+
+class CComMultiThreadModel
+{
+};
+
+template <class DummyThreadModel> class CComObjectRootEx
+{
+public:
+    HRESULT FinalConstruct()
+    {
+        return S_OK;
+    }
+    void FinalRelease()
+    {
+    }
+};
+
+template <class Base> class CComObject : public Base
+{
+public:
+    virtual ~CComObject() { this->FinalRelease(); }
+};
+
+} /* namespace ATL */
+
+
 /**
  *  'Constructor' for the component class.
@@ -463,5 +460,5 @@
     }                                                                         \
                                                                               \
-    CComObject<_InstanceClass> *inst = new CComObject<_InstanceClass>();      \
+    ATL::CComObject<_InstanceClass> *inst = new ATL::CComObject<_InstanceClass>(); \
     if (NULL == inst) {                                                       \
         rv = NS_ERROR_OUT_OF_MEMORY;                                          \
Index: /trunk/include/VBox/com/ptr.h
===================================================================
--- /trunk/include/VBox/com/ptr.h	(revision 60765)
+++ /trunk/include/VBox/com/ptr.h	(revision 60766)
@@ -490,5 +490,5 @@
 # endif
 #else /* VBOX_WITH_XPCOM */
-        CComObject<T> *obj = new CComObject<T>();
+        ATL::CComObject<T> *obj = new ATL::CComObject<T>();
         if (obj)
             rc = obj->FinalConstruct();
