开发者

Enumerating COM collections using foreach

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜