What's wrong with the MSDN example? http://msdn.microsoft.com/en-us/libr...(v=VS.85).aspx