How I like to code

Monthly Archives: April 2011

Setting a boost shared_ptr to NULL

If you need to set a boost shared_ptr to NULL, then you can do it like this: ?View Code CPPboost::shared_ptr<OohClass>(); So, if you have a function that returns a boost shared_ptr and you want to pass NULL to represent either an error state or a not-found state, you can do this: ?View Code CPP#include <map> […]

How to switch between a header file and implementation file in Visual Studio

There used to be a button that would toggle you between the header file and implementation file that currently had the focus in Visual Studio. For reasons unknown to me, that feature was taken out in Visual Studio. Here is a macro though that brings that functionality back: I want my toggle button back!

Copying a project file to a known location

Within a Visual Studio C++ solution, you can copy a file to a known location as part of the build process. To do that, you have so set the “Custom Build Step” parameters found in the Visual Studio project’s property page: Command line: copy “$(InputPath)” “$(TargetDir)” > nul Description: Copying $(InputFileName) Outputs: $(TargetDir)$(InputFileName) Note, the […]


I found this useful tool, thanks to my coworker, that is an alternative to using the otool tool: MacDependency


Right now I’m dealing with some code of mine that isn’t working on a Microsoft product. I got a webcam, a Microsoft Life Cam VX1000, that doesn’t want to work with DirectX. It’s weird. A Microsoft product that doesn’t want to work with a Microsoft SDK. I see on the web though that there are […]