tags:

views:

81

answers:

2

hi,

I need to use tree structure inside a ATL COM server. I thought of using stl::map<> for this purpose as follows.

BaseMap[k1,NextLevelMap[k2, NextLevelMap[k3, Value]]]

But I need to know, whether using such a structure inside ATL is safe and possibility of debugging support with maps.

Thank you

+4  A: 

STL classes are ordinary classes, nothing special. You can use them in COM servers provided you take care of multithreading issues - the stuff called "apartments", since STL classes are not thread-safe by themselves.

You can debug STL classes just like all other classes provided you compile the project appropriately - with debug information enabled.

sharptooth
+4  A: 

C++ standard library classes are safe to use with ATL - ATL even includes a couple of classes specifically designed to interface with containers following standard library conventions: ICollectionOnSTLImpl and CComEnumOnSTL.

Debugging is also fine - the Visual Studio debugger hides the implementation of the standard containers and instead shows a logical view of what they contain.

Joe Gauterin