| 53 | // We know we use "this" in the initialization list, we also know we don't modify *phr. |
| 54 | #pragma warning( disable : 4355 4100 ) |
| 55 | CUnknown::CUnknown(TCHAR *pName, LPUNKNOWN pUnk, HRESULT *phr) |
| 56 | : CBaseObject(pName) |
| 57 | /* Start the object with a reference count of zero - when the */ |
| 58 | /* object is queried for it's first interface this may be */ |
| 59 | /* incremented depending on whether or not this object is */ |
| 60 | /* currently being aggregated upon */ |
| 61 | , m_cRef(0) |
| 62 | /* Set our pointer to our IUnknown interface. */ |
| 63 | /* If we have an outer, use its, otherwise use ours. */ |
| 64 | /* This pointer effectivly points to the owner of */ |
| 65 | /* this object and can be accessed by the GetOwner() method. */ |
| 66 | , m_pUnknown( pUnk != 0 ? pUnk : reinterpret_cast<LPUNKNOWN>( static_cast<PNDUNKNOWN>(this) ) ) |
| 67 | /* Why the double cast? Well, the inner cast is a type-safe cast */ |
| 68 | /* to pointer to a type from which we inherit. The second is */ |
| 69 | /* type-unsafe but works because INonDelegatingUnknown "behaves */ |
| 70 | /* like" IUnknown. (Only the names on the methods change.) */ |
| 71 | { |
| 72 | // Everything we need to do has been done in the initializer list |
| 73 | } |
| 74 | #pragma warning( default : 4355 4100 ) |
| 75 | |
| 76 | /* QueryInterface */ |
nothing calls this directly
no outgoing calls
no test coverage detected