开发者

Enumerating COM collections using foreach

开发者 https://www.devze.com 2023-02-09 03:13 出处:网络
Many people are recommending (link) enumerating COM collections using a foreach is a bad idea and always use normal for loop to iterate. I have an Outlook Addin which uses foreach to iterate over Item

Many people are recommending (link) enumerating COM collections using a foreach is a bad idea and always use normal for loop to iterate. I have an Outlook Addin which uses foreach to iterate over Items coll开发者_如何学Goection and fails with 0x9AC70005 exception for some users. So I am wondering is foreach causing any issues?

Can some one help to understand why foreach is a bad idea to iterate COM collections?

0

精彩评论

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