Tag Archives: .NET

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

A WPF custom control in F#

What F# language and syntax features are required to implement a fundamentally object-oriented WPF custom control?

Posted in .NET, F#, Software Development, WPF, Windows | Also tagged , , | 2 Comments

Generating and plotting random numbers

An example of generating random numbers in F# and visualising their distribution using the WPF charting control.

Posted in .NET, F#, Finance, Visual Studio, WPF | Also tagged , , | Leave a comment

FormatException in WPF DataBinding

A FormatException is generated by the WPF DataBinding diagnostics if the original exception text contains curly brackets.

Posted in .NET, Uncategorized, Visual Studio, 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

Visualising Black-Scholes option pricing using F# and WPF

Using F# to create simple plots of Black-Scholes option prices and greeks using WPF.

Posted in .NET, F#, Software Development | Also tagged , | 3 Comments

IL analysis using F#

A description of using F# language features and reflection to enable basic analysis of .NET IL (intermediate language).

Posted in .NET, F#, Software Development | Also tagged , | 2 Comments

Verifying dynamically generated IL

It’s safe to assume that when you use the C#, F# or (heaven forfend) VB.NET compilers, the IL generated for you will be correct. But, if you’re using Reflection.Emit to generate code “by hand” in a dynamic method or assembly it can be difficult to identify problems with the IL you emit. In the majority [...]

Posted in .NET, F#, Software Development | Also tagged , , , , | 2 Comments

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

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