I have been trying hard to win against my computer at chess recently, can anybody suggest where I am going wrong ? It always seems like I get so near and then loose the game. I'm thinking my midgame needs more attention, or is it my endgame ?

You need to work on basic tactics. Other things can wait. It's one thing having a grasp of basic ideas, its another to be able to recognise the ideas instantly and unfailingly.

Try solving a few hundred easy problems. then do them again, until you recognise them and their solutions instantly. Then do another few hundred. My get a little dull, but most other forms of practice wont do much good.

One exception: Getting a book on endings and following the analysis move after move in your head. Learning the endgame patterns isnt as important as practising the visualisation.