在 ATL 中使用 STL

发布于 2024-08-21 10:28:09 字数 202 浏览 1 评论 0原文

我需要在 ATL COM 服务器内使用树结构。 我想到使用 stl::map<>为此目的如下。

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

但我需要知道,在ATL内部使用这样的结构是否安全 以及使用地图进行调试支持的可能性。

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

俏︾媚 2024-08-28 10:28:09

C++ 标准库类可以安全地与 ATL 一起使用 - ATL 甚至包括几个专门设计用于与遵循标准库约定的容器交互的类:ICollectionOnSTLImplCComEnumOnSTL

调试也很好 - Visual Studio 调试器隐藏了标准容器的实现,而是显示了它们所包含内容的逻辑视图。

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.

妞丶爷亲个 2024-08-28 10:28:09

STL类就是普通的类,没有什么特别的。如果您处理多线程问题(称为“公寓”的东西),则可以在 COM 服务器中使用它们,因为 STL 类本身不是线程安全的。

您可以像调试所有其他类一样调试 STL 类,前提是您正确编译了项目 - 并启用了调试信息。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文