Click here to Skip to main content
15,892,643 members
Articles / Programming Languages / C#

Proper Way of Releasing COM Objects in .NET

Rate me:
Please Sign up or sign in to vote.
4.93/5 (7 votes)
2 Aug 2011CPOL1 min read 48.3K   8  
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...

Views

Daily Counts

License

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


Written By
Architect Anodyne Enterprise Security
United States United States
I've spent the last 30+ years building secure, durable code in government, healthcare, and critical infrastructure industries, from FORTRAN 4 to C#, on databases from pre-SQL ISAM ones to Oracle 12, and on platforms from VMS to Linux (not to exclude all common permutations by Microsoft). In my spare time, I teach classes on whole-system design principles from configuring SANS, programming switches, to advanced principles in C# for creating secure, durable code. I am CISSP and CCSP certified, regularly working with legal teams to validate Cloud security and regulatory compliance.

Comments and Discussions