Category Archives: .NET

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 [...]

Also posted in COM, Debugging, Software Development | Tagged , , , , , | Leave a comment

Beware cached IDispatch

I’ve kinda given it away there with the title, but we had an interesting set of symptoms exhibited the other day while trying to call a function in an Excel workbook via F#. It appeared that the function being called would fail depending on what had been called previously. Very odd.
A bit of background: as you [...]

Also posted in COM, Debugging, Excel, F# | Tagged , , , , | Leave a comment

Troubleshooting an InvalidProgramException

One of the developers who uses the .NET/COM interop DLL that I wrote recently informed me that when they used it in a certain way, they would get a fatal System.InvalidProgramException. Nasty. So I set about seeing how I could find out exactly why this was happening: here are the gory details…
To spoil the ending [...]

Also posted in Software Development, WinDbg, Windows | 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 [...]

Also posted in COM, F# | Tagged , , | Leave a comment

Exposing static libraries to .NET using C++/CLI

 
 
I’ve been looking recently at how to make unmanaged C++ code in static libraries available to code written in .NET languages.
There isn’t any direct way of calling into a C++ static library (.lib) from C# code, but this isn’t suprising as they’re very different in terms of how they’re compiled and linked to form an [...]

Also posted in Software Development | Leave a comment

PLINQ – Parallel LINQ

One of the most interesting things in terms of performance that comes out of the move to a more declarative style when using LINQ, is the ability to easily parallelise your computations.
This benefit has been widely understood for some time in the functional programming world, where side-effect free functions can be exploited in combination with [...]

Also posted in Software Development | Leave a comment

.NET goes all functional

It’s interesting to watch how C# has developed over the past few years, becoming more and more like a functional programming language, with a declarative style favoured over the imperative approach of previous generations. This is especially obvious in C# 3.0, with LINQ borrowing and building on some technologies directly from the world of functional [...]

Also posted in Software Development | Leave a comment
  • Follow me on Twitter Follow me on Twitter @voyce

  • Categories

  • Archives