Tag Archives: COM

.NET 4.0 Type Equivalence causes BadImageFormatException

Interop assemblies containing certain constructs will cause a BadImageFormatException in .NET 4.0

Posted in .NET, COM, Debugging, WinDbg, Windows | Also tagged , , , , , | 6 Comments

Beware of using stack-based COM objects from .NET

COM objects that don’t have the expected lifetime can cause chaos when combined with .NETs garbage collection system.

Posted in .NET, COM, Debugging, Software Development, WinDbg | Also tagged , , , , , | Leave a comment

Don’t do anything in DllMain… Please

Thinking of adding some code to your DLLs DllMain function? STOP!

Posted in Debugging, Software Development, Uncategorized, Windows | Also tagged , , , | Leave a comment

Getting IUnknown from __ComObject

How do you find the unmanaged COM object that’s being referenced by a .NET object?

Posted in .NET, COM, Debugging, Software Development, WinDbg, Windows | Also tagged , , , | 4 Comments

Getting .NET type information in the unmanaged world

One of the tools that I write and maintain displays type information for COM objects hidden behind “handles” in Excel spreadsheets. The underlying objects can either support an interface that allows them to be richly rendered to XML, or the viewer will fall-back to using metadata and displaying the supported interfaces and their properties and methods. It [...]

Posted in .NET, COM, Debugging, Software Development | Also tagged , , , , | Leave a comment

F# – A little gotcha with GuidAttribute

Be careful when using the [<Guid("...")>] attribute on your COM-visible classes in F#. If you mistakenly use the curly-bracket delimited format for the GUID, regasm will silently, yes, silently, fail to add any CLSID entries for your class. That means it will be cocreatable by the prog ID, but not the CLSID. Ouch.
No doubt this will be [...]

Posted in .NET, COM, F# | Also tagged , | Leave a comment