Changeset 60766 in vbox for trunk/include/VBox/com
- Timestamp:
- Apr 29, 2016 2:56:19 PM (9 years ago)
- Location:
- trunk/include/VBox/com
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/defs.h
r60765 r60766 279 279 280 280 #include <nsID.h> 281 282 #ifndef VBOX_COM_NO_ATL283 284 namespace ATL285 {286 287 #define ATL_NO_VTABLE288 #define DECLARE_CLASSFACTORY(a)289 #define DECLARE_CLASSFACTORY_SINGLETON(a)290 #define DECLARE_REGISTRY_RESOURCEID(a)291 #define DECLARE_NOT_AGGREGATABLE(a)292 #define DECLARE_PROTECT_FINAL_CONSTRUCT()293 #define BEGIN_COM_MAP(a)294 #define COM_INTERFACE_ENTRY(a)295 #define COM_INTERFACE_ENTRY2(a,b)296 #define END_COM_MAP() NS_DECL_ISUPPORTS297 #define COM_INTERFACE_ENTRY_AGGREGATE(a,b)298 299 /* A few very simple ATL emulator classes to provide300 * FinalConstruct()/FinalRelease() functionality with XPCOM. */301 302 class CComMultiThreadModel303 {304 };305 306 template <class DummyThreadModel> class CComObjectRootEx307 {308 public:309 HRESULT FinalConstruct()310 {311 return S_OK;312 }313 void FinalRelease()314 {315 }316 };317 318 template <class DummyThreadModel> class CComObject319 {320 public:321 virtual ~CComObject() { this->FinalRelease(); }322 };323 324 } /* namespace ATL */325 326 #endif /* !VBOX_COM_NO_ATL */327 281 328 282 #define HRESULT nsresult … … 442 396 #ifndef VBOX_COM_NO_ATL 443 397 398 namespace ATL 399 { 400 401 #define ATL_NO_VTABLE 402 #define DECLARE_CLASSFACTORY(a) 403 #define DECLARE_CLASSFACTORY_SINGLETON(a) 404 #define DECLARE_REGISTRY_RESOURCEID(a) 405 #define DECLARE_NOT_AGGREGATABLE(a) 406 #define DECLARE_PROTECT_FINAL_CONSTRUCT() 407 #define BEGIN_COM_MAP(a) 408 #define COM_INTERFACE_ENTRY(a) 409 #define COM_INTERFACE_ENTRY2(a,b) 410 #define END_COM_MAP() NS_DECL_ISUPPORTS 411 #define COM_INTERFACE_ENTRY_AGGREGATE(a,b) 412 413 /* A few very simple ATL emulator classes to provide 414 * FinalConstruct()/FinalRelease() functionality with XPCOM. */ 415 416 class CComMultiThreadModel 417 { 418 }; 419 420 template <class DummyThreadModel> class CComObjectRootEx 421 { 422 public: 423 HRESULT FinalConstruct() 424 { 425 return S_OK; 426 } 427 void FinalRelease() 428 { 429 } 430 }; 431 432 template <class Base> class CComObject : public Base 433 { 434 public: 435 virtual ~CComObject() { this->FinalRelease(); } 436 }; 437 438 } /* namespace ATL */ 439 440 444 441 /** 445 442 * 'Constructor' for the component class. … … 463 460 } \ 464 461 \ 465 CComObject<_InstanceClass> *inst = new CComObject<_InstanceClass>();\462 ATL::CComObject<_InstanceClass> *inst = new ATL::CComObject<_InstanceClass>(); \ 466 463 if (NULL == inst) { \ 467 464 rv = NS_ERROR_OUT_OF_MEMORY; \ -
trunk/include/VBox/com/ptr.h
r60504 r60766 490 490 # endif 491 491 #else /* VBOX_WITH_XPCOM */ 492 CComObject<T> *obj = newCComObject<T>();492 ATL::CComObject<T> *obj = new ATL::CComObject<T>(); 493 493 if (obj) 494 494 rc = obj->FinalConstruct();
Note:
See TracChangeset
for help on using the changeset viewer.