By ian | Published:
April 10, 2010
As part of the sliding puzzle game I’m developing for the iPhone and iPad (well, I can’t survive on the profits from BattleFingers forever), I looked for a way to represent a numeric score and time display in an interesting way. One of the nicer visual effects you could use for this is the “flip-card clock” style, where each number consists of a top and bottom part, and the top part flips down to reveal the next number. It’s been used in a few other places including the home screen in the HTC Diamond device, and its physical, realistic style fits well with the iPad, so I set about creating a version for the iPhone and iPad using the built-in Core Animation library. Read on for more details.
Read More »
By ian | Published:
March 31, 2010
The other day I was trying to understand some strange behaviour in msbuild with regard to how it resolves referenced assemblies. I thought I’d try directly invoking the tasks that are used during the build, specifically ResolveAssemblyReference, so that I could experiment with them in F# interactive. It turned out to be pretty straightforward.
Read More »
By ian | Published:
March 17, 2010
Today I was trying to track down some – how can I put this politely – “unusual” memory usage in some unmanaged code running inside Excel. I broke out WinDbg and tried the usual suspects to get an idea of how memory was being used. Unfortunately, the way that msvcr80.dll is built stopped me from getting decent stack traces for the allocations, so I decided to try and rebuild it with a fix to remedy the situation.
Read More »
By ian | Published:
March 11, 2010
It was fascinating to see Apple unveiling its new iPad hardware recently, and one of the things that caught my eye were the interfaces of the various apps that were demonstrated. They look different from apps on other platforms, and even from the equivalent apps on the iPhone. It seems to me as if there’s been a change to a more naturalistic style of user interfaces. Why is this, and what is it about the iPad that makes it suited to this kind of UI?
Read More »
By ian | Published:
March 5, 2010
Yes I know, shocking isn’t it? Too busy doing work that pays the bills to blog about random things I find interesting or amusing.
So what’s been keeping me away from WordPress?
- Spending too much time in WinDbg tracking down .NET and COM memory issues.
- Wanting to have a good look at Visual Studio 2010 and .NET 4.0 (though not as much as I’d like, yet)
- Playing lots of Bayonetta
, and some Heavy Rain
.
- Doing lots of internal demos of the WPF\F# GUI-building toolset we’ve been working on. Should be interesting, specially now Luca’s coming on board.
- Experimenting with iPad development
Hopefully I’ll get the chance to write something about all of this soon.
By ian | Published:
January 31, 2010
On Windows, if you regularly change screen resolution or size, perhaps by accessing a machine remotely, you might find some of your application windows are no longer visible; they’re positioned outside of the visible display area. If you can’t see the window, it can be a little difficult to use the application. How can you get that window back?
Read More »
By ian | Published:
January 26, 2010


Pegs vs Triads
I’ve had two very different iPhone gaming experiences over the last few weeks:
Peggle and
Grand Theft Auto: Chinatown Wars. It’s safe to say I got completely addicted to Peggle, but when it arrived I couldn’t resist the temptation of having the GTA universe in my pocket too. After shelling out the almighty sum of £5.99 on the sandbox triad-’em-up, I discovered that there were many aspects of playing/using Peggle that make it a better fit on the iPhone than GTA. Let’s break down how these very different experiences manage the transition to a hand-held, “casual” gaming platform. What exactly does “usability” mean in this context?
Read More »
By ian | Published:
January 21, 2010
There are all sorts of nasty things to be aware of if you’re mixing reference-counted COM objects with garbage-collected .NET. For instance, if you’re implementing COM objects in C++ then you’re free to allocate them anywhere you like; on the heap or perhaps on the stack if you know they’re only used in some specific scope.
But what happens if during the lifetime of that stack based COM object, it gets used from .NET? A runtime callable wrapper (RCW) will be created around the object. And this RCW expects to be able to keep the underlying object alive by incrementing its reference count. Of course, the stack-based object will soon go out of scope, and regardless of its reference count the object will be destroyed and the pointer that the RCW contains will no longer be valid. It points into the stack, so when the RCW gets cleaned-up, the CLR will call via this pointer into memory that contains garbage and you’ll get something nasty like an access violation or illegal instruction exception.
Read More »
Posted in .NET, COM, Debugging, Software Development, WinDbg | Tagged .NET, c++, COM, Debugging, mscorwks, win32, WinDbg |
By ian | Published:
December 14, 2009
In the world of WPF with its powerful templating support, you’re much less likely to need to build a custom control from scratch than you are with legacy Windows GUI frameworks. For the vast majority of scenarios it’s possible to take an existing control and modify its appearance and behaviour to get what you need. However it is still possible and sometimes necessary to build something in code. The other day I was looking at creating one – using F# of course – and realised that a skeleton control serves as a good example of the kind of cross-paradigm features the language offers. They’re the kind of things that make it possible to use functional F# with inherently imperative .NET languages and frameworks like WPF.
Read More »
By ian | Published:
December 3, 2009
Novice Windows programmers can often think that DllMain is a good place to get that one-time set-up and tear-down work done. It seems to offer an ideal opportunity to know when your DLL has just been loaded, and when it’s about to be unloaded. What better place to add all that expensive, complicated initialisation…? STOP! WAIT! Before you add anything in DllMain, make sure you understand what state the process will be in when it gets called. Once you know that, you may well change your mind…
Read More »