We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 544b734 commit a414c88Copy full SHA for a414c88
sdk/lib/atl/atlcomcli.h
@@ -59,6 +59,13 @@ inline HRESULT AtlHresultFromLastError() throw()
59
return HRESULT_FROM_WIN32(dwError);
60
}
61
62
+template <class T>
63
+class _NoAddRefReleaseOnCComPtr : public T
64
+{
65
+ private:
66
+ virtual ULONG STDMETHODCALLTYPE AddRef() = 0;
67
+ virtual ULONG STDMETHODCALLTYPE Release() = 0;
68
+};
69
70
template<class T>
71
class CComPtr
@@ -173,10 +180,10 @@ class CComPtr
173
180
return p;
174
181
175
182
176
- T *operator -> ()
183
+ _NoAddRefReleaseOnCComPtr<T> *operator -> () const
177
184
{
178
185
ATLASSERT(p != NULL);
179
- return p;
186
+ return (_NoAddRefReleaseOnCComPtr<T> *)p;
187
188
};
189
0 commit comments