michael@0: // Test05.cpp michael@0: michael@0: #include "nsIDOMNode.h" michael@0: #include "nsCOMPtr.h" michael@0: michael@0: NS_DEF_PTR(nsIDOMNode); michael@0: michael@0: /* michael@0: Windows: michael@0: raw, nsCOMPtr 21 bytes michael@0: michael@0: Macintosh: michael@0: Raw, nsCOMPtr 64 bytes michael@0: */ michael@0: michael@0: class Test05_Raw michael@0: { michael@0: public: michael@0: Test05_Raw(); michael@0: ~Test05_Raw(); michael@0: michael@0: void /*nsresult*/ GetNode( nsIDOMNode** aNode ); michael@0: michael@0: private: michael@0: nsIDOMNode* mNode; michael@0: }; michael@0: michael@0: Test05_Raw::Test05_Raw() michael@0: : mNode(0) michael@0: { michael@0: // nothing else to do here michael@0: } michael@0: michael@0: Test05_Raw::~Test05_Raw() michael@0: { michael@0: NS_IF_RELEASE(mNode); michael@0: } michael@0: michael@0: void // nsresult michael@0: Test05_Raw::GetNode( nsIDOMNode** aNode ) michael@0: // m64, w21 michael@0: { michael@0: // if ( !aNode ) michael@0: // return NS_ERROR_NULL_POINTER; michael@0: michael@0: *aNode = mNode; michael@0: NS_IF_ADDREF(*aNode); michael@0: michael@0: // return NS_OK; michael@0: } michael@0: michael@0: michael@0: michael@0: class Test05_nsCOMPtr michael@0: { michael@0: public: michael@0: void /*nsresult*/ GetNode( nsIDOMNode** aNode ); michael@0: michael@0: private: michael@0: nsCOMPtr mNode; michael@0: }; michael@0: michael@0: void // nsresult michael@0: Test05_nsCOMPtr::GetNode( nsIDOMNode** aNode ) michael@0: // m64, w21 michael@0: { michael@0: // if ( !aNode ) michael@0: // return NS_ERROR_NULL_POINTER; michael@0: michael@0: *aNode = mNode; michael@0: NS_IF_ADDREF(*aNode); michael@0: michael@0: // return NS_OK; michael@0: }