开发者

IntelliSense shows different sets of functions for CComPtr<T> depending on whether I use dot or arrow operator [closed]

开发者 https://www.devze.com 2023-03-22 10:57 出处:网络
Closed. This question needs details or clarity. It is not currently accepting answers. 开发者_C百科
Closed. This question needs details or clarity. It is not currently accepting answers.
开发者_C百科

Want to improve this question? Add details and clarify the problem by editing this post.

Closed 9 years ago.

Improve this question

In my code I have

CComPtr<SomeInterface> object;

When I use object. IntelliSense shows a set of available functions. And when I use object-> it shows me another set of available functions. Why are those function sets different?


With such declaration:

CComPtr<T> object;

using dot you access members of CComPtr class, for example, CComPtr.Detach() method:

*doublePointerToT = object.Detach(); // pass ownership - calls CComPtr<T>::Detach()

and using arrow you gain the stored T* pointer and then arrow operator is applied to T* retrieved and so you see members of T:

 object->QueryInterface( ... ); //calls T::QueryInterface()

So with dot you see member functions of CComPtr class and with arrow you see functions of T class.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号