Updated for VC++ sample