Category Archives: Windows

Where’s my window?

Where’s my window gone? I’m sure I left it around here somewhere…

Posted in Windows | Tagged , , , , , , | 1 Comment

A WPF custom control in F#

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

Also posted in .NET, F#, Software Development, WPF | Tagged , , , | 2 Comments

Don’t do anything in DllMain… Please

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

Also posted in Debugging, Software Development, Uncategorized | 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.

Also posted in .NET, Uncategorized, Visual Studio | Tagged , , , , | Leave a comment

Getting IUnknown from __ComObject

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

Also posted in .NET, COM, Debugging, Software Development, WinDbg | Tagged , , , , | 4 Comments

Finding the largest free block of address space

I’ve been seeing problems recently with fragmented virtual address space. During the lifetime of a process, bits and pieces of memory are allocated throughout the 2GB 32-bit address space to such an extent that large contiguous blocks of free space are no longer available. If anything subsequently requires a large block of memory (like, for [...]

Also posted in Software Development, WinDbg | Tagged , , , , , | 2 Comments

Diagnosing out of memory errors with VMMap

VMMap is a new tool from Mark Russinovich et al that’s very useful for diagnosing virtual memory/address space exhaustion issues. I describe it here, and give some information that should help you interpret what it reports.

Also posted in Debugging, Software Development, WinDbg | Tagged , , , , | 1 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 .NET, Software Development, WinDbg | Tagged , , , , , , , , | Leave a comment

Programmatically checking memory usage

One of the things that’s useful in a pre-release check is do a regression test on the memory usage of your unmanaged functions. This should help to ensure that the fantastic new data structure you introduced doesn’t cost too much in additional storage for the order-of-magnitude performance improvement you were boasting about.
Like most of my posts, this assumes that [...]

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

Creating a featherweight debugger

What do I mean by “featherweight debugger”? I mean implementing just enough of the debugging framework to get what we need from the debuggee and nothing more.
The problem I was trying to solve was how to get more information from first chance exceptions. We have a great deal of library code that uses catch(…) blocks [...]

Also posted in Debugging, Software Development, WinDbg | 5 Comments