Stories Tagged with 'COM'


COM Objects and IDisposable?

I haven't dealt with a ton of COM interop up to this point in my .NET life.  I was surprised to find out that there is not a good story for deterministic deconstruction of COM objects...or maybe there is and I didn't see it.

What I've come up with is a bit of a hack to wrap a com object in a IDisposable wrapper so that I can use the using{...} syntax to determine Release() calls (not really destruction, but good enough for most cases).  The code looks like this:

Shawn
Shawn Wildermuth
Author, Teacher, and Coach




My Courses

Wilder Minds Training
Vue.js by Example
Bootstrap 4 by Example
Intro to Font Awesome 5 (Free Course)
Pluralsight
Designing RESTful Web APIs (new)
Building an API with ASP.NET Web API
Building an API with ASP.NET Core
Building a Web App with ASP.NET Core, MVC6, EF Core, Bootstrap and Angular
Less: Getting Started

Application Name WilderBlog Environment Name Production
Application Ver v4.0.30319 Runtime Framework x86
App Path D:\home\site\wwwroot\ Runtime Version .NET Core 3.0.0
Operating System Microsoft Windows 10.0.14393 Runtime Arch X86