I have a D40 but am looking to buy a midrange Canon DSLR, as we'd be using both cameras on the same excursions I'd really want to make a choice on body largely on the ability of it to share lenses with the D40 (to save money).
Not really. I think there are adaptors to fit Nikon lenses to Canon (but not the other way) but you don't get autofocus or even electronic aperture control.
Is there a particular reason why you're not considering a mid-range Nikon? It would make more sense if you're looking for a new body that could share lenses with the D40.
Yeah definitely and that's what I would prefer to do, however the gf is into Canons and recently gave hers away to her brother - she's adamant it's a Canon she wants again. She prefers the colours taken with a Canon, personally I think Nikons are more accurate, but I don't want to start squabbling over it.