The thing I was complaining about was you global instance of COMInit. It's unnecessary and globals are evil. :-)
This is way off-topic wrt the original post, but ah well.
I've always been of the 'globals-are-evil' school myself, however recently I've started reconsidering. For example, what do you suggest as a good way to handle an object like a Preferences object, something that you need almost everywhere? It would of course be possible to pass around pointers from function to function but you'll have to agree that that is even more ugly than a global object. What's more is that it is always possible that you'll have to add a preference later where you didn't anticipate it, so you'd have to redo all functions that lead to that point. IMHO this is a case where a global object is very useful. I've also tried using a static function in the Preferences class before, but in the end that's just a global in disguise.
How do you suggest handling this without globals?
cheers,
roel
