Bob Moore's Coding Tips

This site is intended to help fellow developers, and also to explain a little about me (go to the "Your Host" pages to find out more). It exists as somewhere I can refer people to, rather than having to cut and paste the same code into UseNet or Stack Overflow messages a zillion times over. The site contains over 70 useful code fragments and tips for Windows programmers, and also links to related sites which fellow sufferers at the forge of Microsoft might find interesting : see the buttons on the left.

The C# code is all new-ish. It would be all trendy and fashionable... if I went in for that kind of thing. You kids and your "rock" music... bah. :)

The C++ code is quite old, so don't expect to see much in the way of proper Unicode text handling etc. It's not necessary to demonstrate the principles, and I can't be bothered to update this much code, so let's just both pretend it's there, OK?

What's New: 

6th June 2022 Added an article on the woes of fitting an M.2 heatsink
20th Aug 2021 Added a new picture of my machine's internals after a memory upgrade
2nd Sept 2020 Added the opinion piece Why I Gave Up Management
31st May 2020 Fixed some broken links on the my history page
Feb 7th 2020 Updated the wine page with La Casetta
Dec 15th 2019 Updated the wine page with Domodo Negroamaro
June 27th 2019 Updated the garden page with Rosa Deep Secret
May 6th 2019 Updated the office picture for some new hardware on my desk
Jan 26th 2018 Updated the wine page
Feb 11th 2017 Added native code tip 81: My VS2015 code won't run on XP or 2003 - why?
Dec 22nd 2016 Moved my site to its new domain.
Feb 25th 2016 Added native code tip 80: Cannot access private member declared in class 'CObject'... WTF?
Feb 17th 2016 Added Wellington Bomber porter to the gluten-free beer list.
Oct 26th 2014 Updated .Net Tip 4 to make the use of the CallingConvention attribute clearer.
Dec 20th 2013 Added a general Visual Studio performance tip: My Visual Studio .Net IDE runs very slowly. Why?
July 28th 2013 Complete site redesign using Twitter Bootstrap.

You can contact me by mailing bobm at Please let me know if the site has been of assistance to you, or if you've found a bug in the HTML (or a bug in a code sample), or if you would like to see additional features or samples.

But.... if you have a specific programming problem, post it publicly on one of the following Usenet newsgroups :

(or post it to Stack Overflow)

because I never respond to direct unsolicited email.

Oh and by the way - I do NOT work for Microsoft. Never have done. Those MVPs who went to work for Microsoft had to give up their membership of the program, and now I'm not an MVP any longer (eight years was long enough anyway), I probably won't get the chance. I didn't take the chance of an interview when it was offered : mostly because I wouldn't give up being a developer to be a support person, but partially because I don't like what Microsoft has become. If you don't understand that comment, see this posting made by Joel Spolsky years ago, with particular reference to the "two forces" section. I always counted myself as being in the Raymond Chen camp.