Click here to Skip to main content
15,879,348 members
Articles / Programming Languages / C#

Proper Way of Releasing COM Objects in .NET

Rate me:
Please Sign up or sign in to vote.
4.50/5 (13 votes)
3 Dec 2012CPOL3 min read 60.9K   26  
Fully release resources engaged by COM objects.

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
2 Aug 2011Crooked Path
Please let me suggest that "FinalReleaseComObject" is not the way to go. If you write structured code, you should never need it. Strictly following Microsoft Patterns & Practices:1) Declare & instantiate COM objects at the last moment possible.2) ReleaseComObject(obj) for ALL...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
China China
I am now programming applications for the Internet of Things.

Comments and Discussions