views:

236

answers:

1

Hello, I am doing some COM related things with directshow such as:

typedef CComPtr<IBaseFilter> AutoIBaseFilterPtr;
map<CString, AutoIBaseFilterPtr> _filterMap;

To store a list of directShow related com objects and their friendly name.

After finding this article (See:Problem 2) on how changes in VC10 compiler might effect previously OK code, I am wondering if there are any more things to watch out for when mixing the STL and CComPtr or prehaps just mixing the STL and COM in general.

Any tips would be greatly appreciated, thanks

+1  A: 

The only slight thing I can think of that hasn't been mentioned is that CAdapt is required for CComBSTR as well as CComPtr, because it overloads operator& too.

In fact, it is overloading operator& that makes CAdapt necessary, as many STL containers require that taking the address of something X returns a pointer to said X.

Kim Gräsman
Marked as answer, even though my question was sort of open ended, you are the only one to reply :)
YoungPony
Pavel Minaev
Pavel; thanks for the added info, I still haven't looked into VS2010. I need to read up on std::addressof -- looks interesting!
Kim Gräsman