} CEnumString::~CEnumString() { } ///////////////////////////////////////////////////////////// // CEnumString message handlers ULONG FAR EXPORT CEnumString::AddRef() { TRACE_LINE("CEnumString::AddRef\n"); return ::InterlockedIncrement(reinterpret_cast<LONG*>(&m_nRefCount)); } ULONG FAR EXPORT CEnumString::Release() { TRACE_LINE("CEnumString::Release\n"); ULONG nCount = 0; nCount = (ULONG) ::InterlockedDecrement(reinterpret_cast<LONG*>(&m_nRefCount)); if (nCount == 0) delete this; return nCount; } HRESULT FAR EXPORT CEnumString::QueryInterface( REFIID riid, void FAR* FAR* ppvObject ) { HRESULT hr = E_NOINTERFACE; if (ppvObject != NULL) { *ppvObject = NULL; if (IID_IUnknown == riid) *ppvObject = static_cast<IUnknown*>(this); if (IID_IEnumString == riid) *ppvObject = static_cast<IEnumString*>(this); if (*ppvObject != NULL) { hr = S_OK; ((LPUNKNOWN)*ppvObject)->AddRef(); } |